in reply to why does array return the hash value?

If $variable contains a hashreference, it means @array contains a hashreference. It's not that @array is one.

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.