use XML::LibXML; #Parse XML my $template = 'xmldocument.xml'; my $parser = XML::LibXML->new(); my $pdoc = $parser->parse_file($template); #Remember the namespace my $rdoc = XML::LibXML::XPathContext->new($pdoc->documentElement()); $rdoc->registerNs( ns => 'http://url/Schema' ); #Find desired node(s) my @stuff = $rdoc->findnodes("//ns:source_name"); #Print results for(@stuff) { my $data = $_->textContent; print"$data\n"; }