XML Parse Error - Extra content at the end of the document
Solution 1:
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>
Solution 2:
Make sure you also triple check for a duplicate urlset declaration at the top of your document. This was my problem. It was a very careless oversight.
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9"
url="http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">