in reply to why does array return the hash value?
I don't know the function XMLP::GetElementsByName, but I wouldn't be surprised if it returns an object - and the object is implemented as a hashref.