#!usr/bin/perl -w use strict; use warnings; use XML::LibXML qw( ); use XML::LibXML::XPathContext qw( ); my $file = $ARGV[0]; my $parser = XML::LibXML->new (); my $dom = $parser->load_xml( location => $file ); my $root = $dom->getDocumentElement(); my $xpc = XML::LibXML::XPathContext->new($root); $xpc->registerNs( 'Borkbot' => 'http://www.Borkbot.com/content', ); my @nodes = $xpc->findnodes('//Borkbot:resourceFilename'); foreach my $node (@nodes) { print $node->to_literal; }