use XML::Parser; my $p = XML::Parser->new(Style => 'Tree'); my $tree = $p->parsefile('foo.xml'); #### print Dumper( $tree );