Where there are funky characters in the XML file,DOMDocument->load complained about them, saying that they weren't UTF-8, and to specify the encoding.
For example,
Warning: DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xE4 0x3C 0x2F 0x66 in Entity, line: 1 in test.php on line 6
with doc->recover=false(default) : failed
Solution:
<?php
$doc = new DOMDocument('1.0', 'iso-8859-1');
$doc->load($xmlPath);
?>
Edit: Since it appears that...