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