. #### use XML::LibXML::Reader; my $reader = XML::LibXML::Reader->new(location => "map.xml"); my $pattern = XML::LibXML::Pattern->new('/world'); my @matchedNodes; while ($reader->nextPatternMatch($pattern)) { push @matchedNodes, $reader->copyCurrentNode(1); }