I have run into this issue twice now. I am using PHP to pass XML data to a loader object. Viewing of the PHP page and XML didn't lead me to the answer right away. Everything looked fine. XML was properly formatted. Code APPEARED to be correct and, as stated, produced the correct XML. What I ended up discovering is that I was cleaning up some variables in PHP at the end of my process, manual garbage collection. A variable I had stopped using was still in the clean up process. After removing the clean up process for that nonexistent variable, the error disappeared. Long story short, don't delete variables you never declared.