Enterprise Architect 4.1RR #### use strict; use warnings; use Data::Dumper; use XML::Twig; my $twig = XML::Twig->new( twig_roots => { 'UML:Class' => \¨_class } ); $twig->parsefile( 'testfile.xmi' ); sub uml_class { my ( $twig, $section ) = @_; my $elt = $twig->first_elt; my $struct = $elt->simplify( forcearray => 1 ); print Dumper( $struct ); # parse the block and extract the data elements $twig->purge; }