my $str = $ARGV[0]; my $xp = XML::XPath->new(xml => "$str"); my $nodeset = $xp->find('//h1/title'); # foreach my $node ($nodeset->get_nodelist) {my $tag=XML::XPath::XMLParser::as_string($node); print "$tag\n";}