use strict; use XML::Parser; my $xml = XML::Parser -> new(Style => 'Tree'); my $tree = $xml->parsefile("demo.xml"); use Data::Dumper; print Dumper($tree);