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. >)
Does anyone know of a way to get it to keep it as an entity, it really messes up string comparisons when it converts to something unexpected.
The following code reproduces the problem you will notice the length of the dump is 3 when it should be 6.
<?php
$xml='<?xml version="1.0"?>
<root>
<element>></element>
</root>';
$a=new DOMDocument();
$a->loadXML($xml);
var_dump($a->childNodes->item(0)->nodeValue);