XML Parse Error – Extra content at the end of the document

XML can only have one “document entity” or “root”, you’re trying to use two (status and format). Wrap your two elements in a single one, so that your XML document only has one root element.

Bad

<?xml version="1.0"?>
<status>success</status>
<format>xml</format>

Good

<?xml version="1.0"?>
<response>
  <status>success</status>
  <format>xml</format>
</response>

Leave a Comment