in reply to Comparing nodes in LibXML

If you look in the docs for XML::LibXML::Node you will see:
isEqual deprecated version of isSameNode(). isSameNode returns TRUE (1) if the given nodes refer to the same node structure, +otherwise FALSE (0) is returned.
In other words, it checks to see if it is the very same node, so even if you change the prefix of the second element (in $xmls2) to Z1, isEqual() will still return false. I assume isEqual() has been deprecated because of this.

You could have a look at localname() in the XML::LibXML::Node docs, and setNamespaceDeclURI() and setNamespaceDeclPrefix() in the XML::LibXML::Element docs.