Lesson 1 of 6

Why XML?

Imagine you need to send a document — not just a blob of values, but something with real structure: a book with chapters, a chapter with paragraphs, a paragraph with some words in bold. Plain text can't describe that shape on its own, and it needs to be something both a human and a machine can read the same way. That's the gap XML — Extensible Markup Language — was built to fill: a way to wrap data and documents in labelled tags so the structure is explicit, self-describing, and verifiable against a single shared standard.

💡 The Bottom Line

XML exists to represent structured information — documents and data — in a format that's both human-readable and machine-parseable, using nested tags that describe what each piece of content is. It became a W3C standard in 1998 and, for over a decade, was the default way enterprise systems, APIs, and documents exchanged structured information.

Where XML came from

XML wasn't invented from scratch — it's a simplified descendant of SGML (Standard Generalized Markup Language), a much older and more complex markup standard from the 1980s. In the late 1990s, the W3C carved out a leaner subset of SGML's ideas, published it as the XML 1.0 specification in 1998, and it quickly became the format of choice for describing structured data on the web — precisely because it was simpler than SGML but far more rigorous than ad-hoc text formats.

<?xml version="1.0" encoding="UTF-8"?>
<library>
  <book>
    <title>The Pragmatic Programmer</title>
    <author>Andy Hunt</author>
  </book>
</library>

🙋 There Are No Dumb Questions

Q: Isn't XML just "old HTML"?
A: They're related but not the same thing. HTML is one specific, fixed vocabulary of tags (<p>, <div>, <table>...) meant for describing web pages. XML is a meta-language — a set of syntax rules for inventing your own tags to describe whatever you need. HTML happens to have been redefined at one point as an XML application (XHTML), but plain XML lets you make up <book>, <invoice>, or <customer> as needed — there's no fixed tag list.

Its heyday — and where it lost ground

Through the 2000s, XML was everywhere: SOAP web services, enterprise integration, RSS feeds, configuration files, document formats. Then JSON came along, borrowed from JavaScript's own object syntax, and won over most of the API and config-file world with a terser, less ceremony-heavy syntax. We'll do a full head-to-head comparison in Lesson 4 — but the short version is that XML didn't disappear, it just settled into the jobs it's genuinely best at.

⚠️ Watch Out

Don't mistake "JSON became more popular for APIs" with "XML is dead." That's a common misconception. XML is alive and extremely well in plenty of places you use every day — you're just not always aware it's XML under the hood.

Where XML is still very much alive today

📰 RSS & Atom feeds

Podcast feeds and website syndication feeds are XML documents to this day.

🧾 SOAP APIs

Many enterprise and government systems still run on SOAP, which is XML-based end to end.

📁 Office file formats

A .docx or .xlsx file is literally a zip archive full of XML files — open one with any zip tool and see for yourself.

📱 Android layouts

Android app screens are traditionally defined in XML layout files.

🏢 Enterprise & legacy systems

Banking, healthcare, and government data interchange formats are frequently XML-based — and often mandated by decades-old standards.

🖼️ SVG images

Scalable Vector Graphics — the format behind crisp, resizable icons and illustrations — is itself an XML vocabulary.

🔧 Try It Yourself

Find any .docx or .xlsx file on your computer, make a copy, rename the copy's extension to .zip, and open it with your usual archive tool. Inside you'll find a folder full of .xml files — that's what Word and Excel are actually built on.

✅ Quick Check

Which of these is true about XML today?


Next up: the actual syntax rules that make an XML document "well-formed" — tags, nesting, and the one rule almost everyone forgets at least once.

← Back to
Next →