in reply to Re^2: XPath query issue...
in thread XPath query issue...

I don't know how fast a parser you are using. XML::LibXML is extremely fast.

Each XPath is surely parsed repeatedly. You could avoid using XPath inside the loop.

Each find will search through all of the child nodes, but since it seems you want most of the child nodes. You could replace the XPath with a loop that populates a hash.