XML

A structured, tag-based data format, common in enterprise and legacy systems.

SpecializedbeginnerBeginner-friendlyGuide only -- no course yet

Overview

XML (eXtensible Markup Language) is a structured, self-describing tag-based data format that predates JSON as the standard for structured data exchange. JSON has largely replaced it for web APIs due to its lighter syntax, but XML remains common in enterprise systems, document formats (like .docx), and configuration files.

What it is
A markup-based format for representing structured, hierarchical data using nested tags.
Why it's used
It supports schemas (XSD) for strict validation and namespaces for combining vocabularies -- still valuable in enterprise/document contexts, even though JSON is lighter for typical web APIs.
Where it fits
Enterprise data interchange, SOAP-based web services, configuration files, and as the internal format of many document types (.docx, .svg).

Core concepts

  • Elements and attributes
  • Well-formed vs. valid XML
  • XML Schema (XSD)
  • XML vs. JSON trade-offs

Example

XML's tag-and-attribute structure resembles HTML because both derive from SGML -- but XML has no predefined tags; every tag name is defined by the document's own schema.

<book id="42">
  <title>Example</title>
  <price currency="USD">12.99</price>
</book>

Common use cases

  • Enterprise data interchange
  • Configuration files
  • Document formats (.docx, .svg, RSS feeds)

Project ideas

  • Convert a small XML document to an equivalent JSON structure by hand, to see the structural mapping

Official references