use strict; use warnings; use XML::TreeBuilder; my $root = XML::TreeBuilder->new; my $xml = do {local $/; }; $root->parse ($xml); my @elements = $root->find ('FormattedReportObjects'); print $_->as_text () . "\n" for @elements;