#!/usr/bin/perl use XML::LibXML; use XML::XPath; $parser = new XML::LibXML; my $doc = $parser->parse_file("/tmp/test.xml"); my $root = $doc->getDocumentElement; my @node = $root->getElementsByTagName('TEST/VERSION/BLAH'); $Version = uc($node[0]->getAttribute('VERSION')); print "->$Version<-\n";