When getting the nodeValue of a DOMNode object that has entities in the nodeValue (i.e. a & gt;) then it converts the entity into it\'s printable character (i.e. >)
loadXML() takes an options argument, and one of the options is LIBXML_NOENT, which enables converting entities to their representations, so by default loadXML() shouldn't do so. However, there appears to be a bug in libxml that causes it to happen all the time, according to this bug report