#!/usr/bin/perl use warnings; use strict; my $a = do {local $/; }; use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(xml => $a); my $nodeset = $xp->find('//@author'); # find all authors foreach my $node ($nodeset->get_nodelist) { print $node->getNodeValue."\n\n"; }