Skip to content

Glossary XML

What Is XML?

Definition

XML (Extensible Markup Language) is a markup language that programs use to store and exchange structured data. Unlike HTML, it has no fixed set of tags: each format built on XML defines its own.

On this page 5
  1. What XML means
  2. How it works
  3. Why it matters
  4. Best practices
  5. Common mistakes
In brief

XML is a markup language for storing and exchanging structured data: what it is, how it works and why sitemaps and feeds rely on it.

What XML means

XML stands for Extensible Markup Language. It is a W3C Recommendation, and the version in force, the fifth edition of XML 1.0, was published on 26 November 2008. "Extensible" means the language itself does not decide which tags exist: a sitemap uses one set, a news feed another and a product catalogue yet another.

HTML and XML look alike at first glance, since both mark up content with tags in angle brackets. The difference lies in what they are for. HTML describes a page so that a browser can display it. XML describes data so that another program can read it: a list of URLs, a product with its price or a news item with its date.

An XML document has to be well-formed. There is exactly one root element, every tag that opens is closed, upper and lower case matter and attribute values sit in quotation marks. If a file breaks one of these rules, the program reading it does not try to guess: it rejects the file.

How it works

An XML file is plain text organised as a tree. The root element contains other elements, and these hold text, attributes or further elements. In a sitemap, for example, the urlset tag wraps one url tag per page, and inside each one the loc tag holds the address and lastmod the date of the last change.

For two programs to understand each other, valid XML is not enough. They have to agree on which tags exist and what they mean, and each format sets that out. The sitemaps protocol, RSS or Atom for feeds and the schemas of product catalogues are agreements of this kind built on XML.

In many modern APIs, JSON has replaced XML because it is lighter to write and easier to read from JavaScript. The structured data Google recommends, for instance, is written in JSON-LD. Sitemaps and a large share of feeds, however, are still XML.

Why it matters

For SEO, XML shows up mainly in the sitemap. Google accepts sitemaps as XML, as RSS or Atom feeds and as plain text files, and it sets clear limits: no more than 50,000 URLs or 50 MB uncompressed per sitemap, encoded in UTF-8. A malformed file or an unescaped character can stop the search engine from processing it.

Google also explains what it reads from each tag. It uses the lastmod date only if it is consistently and verifiably accurate, and it ignores the priority and changefreq tags. A sitemap with real dates is therefore useful, while one that marks every page as changed today loses that value.

The zds.es sitemap, measured on 13 October 2026, is a single XML file of about 190 KB with 1,370 URLs, well below Google's limits. Every URL carries a lastmod date, and not all of them show the day of the measurement: there are 20 different dates, the oldest from April 2026. It also includes the priority tag, which Google says it ignores.

The entry belongs to the glossary page about sitemaps.

Best practices

  • Save XML files in UTF-8 and declare it in the first line.
  • Escape special characters in URLs, such as the ampersand, so the file stays well-formed.
  • Put the real date of the last content change in lastmod, not the date of the site build.
  • Split large sitemaps and group them in a sitemap index before they reach the limit.
  • List the sitemap address in robots.txt and submit it in Search Console.
  • Validate the file after every change to the generator.

Common mistakes

  • Assuming that priority or changefreq influence how Google crawls.
  • Updating lastmod on every URL with each release, even when nothing has changed.
  • Including URLs in the sitemap that redirect, return an error or carry noindex.
  • Using unescaped characters that leave the file malformed.
  • Confusing the XML sitemap for search engines with a site map page for people.
Manuel Riveiro Rodriguez CEO & Digital Strategist

A technical audit covers this and everything else in one pass.

Request an audit

Frequently asked

What is the difference between XML and HTML?

HTML describes pages so that a browser can display them, and it has a fixed set of tags. XML describes data so that another program can read it, and each format defines its own tags. A sitemap or a product feed is XML; the page you see in your browser is HTML.

Does a sitemap have to be XML?

Not necessarily. Google also accepts RSS or Atom feeds and text files with one URL per line. XML is the most widely used because it lets you add details to each URL, such as the date of the last change or the versions in other languages.

Do the priority and changefreq tags do anything?

Not for Google. Its documentation says it ignores the priority and changefreq values. The tag it can use is lastmod, as long as the date is consistent and verifiable. That is why it should reflect the last real change to the content of each page.

What happens if the XML is malformed?

The program reading it does not fix anything: it rejects the file or the part it cannot parse. In a sitemap, an unescaped ampersand or an unclosed tag can stop the search engine from processing the URLs. Validating the file after every change prevents this.

XML or JSON?

It depends on the use. Many modern APIs use JSON because it is lighter, and the structured data Google recommends is written in JSON-LD. Sitemaps and many feeds remain XML, because their protocols define them that way and search engines and platforms expect them in that format.