Skip to main content
XMLDir

Search 309 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, blog and product.

XML sitemap

<urlset>

The root element of every sitemap. Its namespace declaration is what makes the document a sitemap rather than a list of URLs.

There is exactly one <urlset> per file and it contains nothing but <url> elements. The namespace on it is not decoration: a crawler identifies the document by that URI, and a sitemap that declares the wrong one — or none — is a well-formed XML file that no search engine will read as a sitemap.

The protocol's two hard limits live here as well. A single sitemap may carry at most 50,000 URLs and may be at most 50 MB uncompressed; past either, you need a sitemap index pointing at several files.

Parent
None — this is the document element
How many
Exactly one, as the document element.

What it contains

Attributes

  • xmlnsrequiredThe sitemaps.org 0.9 namespace. Omitting it is the most common reason a sitemap is silently ignored.

Cardinality and constraints

Exactly one, as the document element.

  • Must declare xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" — the version is part of the URI and 0.9 is current.
  • At most 50,000 <url> children and 50 MB uncompressed. Beyond that, split and use a sitemap index.
  • Only <url> children are allowed; extension elements go inside a <url>, not beside it.

What our validator does

The sitemap validator counts the <url> children and reports an error when there are none, along with the file size against the 50 MB limit.

Broken and fixed

Both documents below are well-formed XML — that is the point of this corpus — and both are run through the validator on every test run. The verdicts here are what it returned, not what we expect it to.

broken
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>
Sitemap contains no URLs.
fixed
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-08-10</lastmod>
  </url>
</urlset>
No errors. Warnings may remain — a conforming feed can still be missing a self link — but nothing here is wrong.

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.