So I use simplexml with the XML parsing in PHP, but I found that some of the files I needed to parse contains errors. Of course, I could manually edit each and every problematic file, but at about 10000+ files, that would take me forever.
Okay, so about the error. When you try to open the XML file in the browser, this message shows up:

Warning: simplexml_load_string(): Entity: line 2: parser error : Specification mandate value for attribute Inspection in ...
I found the ff. tag is triggering the error (here: Transport instead of Inspection):
<Public Transport Rules>
<PublicTransport id="0">
<Issued>null</Issued>
<Files><localfile>
<location>Citybus</location>
<format>Events</format>
</localfile>
</Files>
</PublicTransport>
</Public Transport Rules>
The spaces within the tags is causing the issue, apparently. And these tags occur more than once in the file.
I think that simplexml parses by what it sees in the browser (at face value), so if there is a problem with your XML file, it wont be able to parse normally. I thought of making PHP parse by reading the source file instead, and perhaps editing the file from there. But it seems any fopens opens to what you read in the browser page.
Been stuck with this problem for a while now. Any advice would be appreciated.
Thanks!