As a followup on this: I have the same issue as well - randomly - when loading any XML file using
simplexml_load_file() on the same server with any application (WordPress, Magento, Joomla). The reason is definitely not that the XML file contains bad characters, bad formatting or does not exist. The issue seems to be related to a pending PHP bug, that occurs when too many PHP applications rely on SimpleXML on the same server.
On a deeper level, the SimpleXML library uses kind of caching that is persistent across multiple requests within the same PHP thread (PHP-FPM instance, mod_php instance, etcetera). It is said to be fixed by updating PHP 5.4, but that hasn't worked yet for me. It does not occur with PHP 5.5 or higher.
One fix is to override
app/Mage.php with the following - locate the commented line and replace it with 3 lines. Core hack, ugly, should not be done, wash your mouth. But it works.
//$localConfig = simplexml_load_file($localConfigFile);
$xmlString = file_get_contents($localConfigFile);
$localConfig = simplexml_load_string($xmlString);
Another workaround is listed here: