in reply to problems with Xpath
getAttribute is an XML::XPath::Node::Element method.
What you (seem to) have is a set of nodes and not a single node.
You will need to iterate on the result set to get single nodes on which you can call getAttribute(s).