See the following example to know how to get the attribute values using javascript.
var myXML = new XML("<root><p att1=\"value1\" att2=\"value2\"></p></root>");
var myXMLElement = myXML.xpath ("//p");
alert(myXMLElement.attributes()[0].name()+": "+myXMLElement.attributes()[0].toString());
~Green4ever