in reply to xpath problem

As often said on this site, do not use XML::XPath, it is not maintained anymore. XML::LibXML is very similar to XML::XPath, except for the fact that it is faster, more powerful, and actively maintained.

And of course, if you can't use XML::LibXML (because libxml2 is not installed/installable on your system(s)), there is always XML::Rules (hi jenda!) and even XML:Twig.