# XML

Category: [Technical SEO](https://seo-geo-glossary.com/en/glossary/category/technical-seo/) › [HTML, mobile & accessibility](https://seo-geo-glossary.com/en/glossary/category/technical-seo/html-mobile-accessibility/) · Also known as: Extensible Markup Language

**XML** (Extensible Markup Language) is a text-based format that describes data in nested elements with self-defined tags. In SEO it appears mostly as the format of XML sitemaps and of feeds.

## How is XML built?

The W3C defines XML as a subset of SGML. A document is well-formed when it follows the syntax rules of the specification, for example one root element, correctly nested elements and a matching end tag for each start tag. Documents that are not well-formed are not XML. Unlike HTML, XML has no fixed set of tags. Authors name the elements themselves or use a vocabulary such as the sitemap protocol. The format became a W3C Recommendation in February 1998. The current edition is the fifth edition of XML 1.0 from November 2008.

## Where does XML matter in SEO?

Most often in the XML sitemap, which lists a site's URLs in a defined structure. Google accepts XML sitemaps, RSS or Atom feeds and text files. The sitemap protocol sets these rules:

- Required elements are `urlset`, `url` and `loc`.
- The file is UTF-8 encoded and special characters such as `&` are escaped as `&amp;`.
- One file holds at most 50,000 URLs and 50 MB uncompressed. Larger sites split into several files listed in a sitemap index.
- Submitting a sitemap is a hint and does not guarantee that Google crawls the URLs.

## Example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/glossary/xml/</loc>
    <lastmod>2026-10-06</lastmod>
  </url>
</urlset>
```

## Common mistakes

- **Special characters not escaped.** In XML sitemaps, `&` must be written as `&amp;`, for example in URLs with parameters.
- **File too large.** One sitemap holds at most 50,000 URLs and 50 MB uncompressed. Larger sites split into several files listed in a sitemap index.
- **Document not well-formed.** A document that breaks the syntax rules, such as a missing end tag, is not XML according to the W3C specification.

## FAQ

**What is an XML file?**
A text file in XML format. It opens in any text editor or browser.

**How does XML differ from HTML?**
HTML has predefined tags and is designed to display content. XML is designed to carry data and uses tags that authors choose.

## Related terms

- [XML sitemap](https://seo-geo-glossary.com/en/glossary/xml-sitemap/index.md)
- [hreflang sitemap](https://seo-geo-glossary.com/en/glossary/hreflang-sitemap/index.md)
- [Sitemap index](https://seo-geo-glossary.com/en/glossary/sitemap-index/index.md)
- [HTML](https://seo-geo-glossary.com/en/glossary/html/index.md)
- [RSS/Atom feed](https://seo-geo-glossary.com/en/glossary/rss-feed/index.md)

## Sources

- [Extensible Markup Language (XML) 1.0 (Fifth Edition) – W3C](https://www.w3.org/TR/xml/)
- [Sitemaps XML format – sitemaps.org](https://www.sitemaps.org/protocol.html)
- [Build and submit a sitemap – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)
- [XML – Wikipedia (secondary)](https://en.wikipedia.org/wiki/XML)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/xml/
