After struggling with attributes for a long time, I finally discovered the easy way to obtain the text value of an attribute in a XML file with a XPath expression.