XML
XML (eXtensible Markup Language) is a flexible markup language that defines rules for encoding documents in a format that is both human-readable and machine-readable.
§ 1 Definition
XML is a markup language that lets you define your own tags. Unlike HTML which has a fixed set of elements, XML has no predefined tags. You create the vocabulary your document needs. This extensibility made XML the foundation of countless data formats: RSS feeds, SVG (which is XML), SOAP APIs, Office documents (DOCX, XLSX are XML archives), and configuration files. XML is verbose. It uses opening and closing tags, namespaces for disambiguation, and attributes for metadata. It supports schemas (XSD) for validation, XPath for querying, and XSLT for transformation. XML dominated the web in the 2000s but has been largely supplanted by JSON for API data exchange. However, XML is far from dead. It is deeply embedded in enterprise systems, publishing workflows, and document-centric applications.
§ 2 How it works
XML documents must be well-formed (proper nesting, one root element) and can be validated against a schema (XSD or DTD). Elements can contain text, other elements, or both (mixed content). Attributes provide metadata on elements. Namespaces prevent name collisions when combining XML from different sources. The DOM API used by browsers works identically for XML and HTML.
§ 3 When to use XML over JSON
Use XML when you need mixed content (text with embedded markup), document validation via schemas, namespace support, or transformation pipelines (XSLT). XML is still the standard for publishing (DocBook, TEI), configuration (Android manifests, Ant builds), and SOAP-based enterprise services.
§ 4 Common misconception
XML is not outdated. It is specialized. JSON replaced XML for API data exchange because JSON is simpler and natively maps to programming language data structures. But JSON cannot do what XML does for documents. If your use case involves complex document structures, schemas, or transforms, XML is still the right tool.
§ 5 Note
§ 6 In code
```xml
<?xml version="1.0" encoding="UTF-8"?>
<book id="978-3-16-148410-0">
<title>XML Fundamentals</title>
<author>Jane Doe</author>
<chapters>
<chapter number="1">Introduction</chapter>
<chapter number="2">Elements & Attributes</chapter>
</chapters>
</book>
```§ 7 Common questions
- Q. What is the difference between XML and HTML?
- A. HTML has a predefined set of tags for web content. XML lets you define your own tags. HTML is more forgiving of errors; XML is strict.
- Q. Is XML still used?
- A. Yes. XML is widely used in enterprise systems, publishing, configuration files, and document formats (SVG, DOCX, XLSX).
- XML is an extensible markup language with no predefined tags.
- XML excels for documents, schemas, and transformation pipelines.
- JSON has replaced XML for most web APIs, but XML is essential in many domains.
Atomic Glue handles XML integration for enterprise systems, RSS feeds, and data transformation. Contact us about your integration needs.
Get in touchXML (eXtensible Markup Language) is a flexible markup language that defines rules for encoding documents in a format that is both human-readable and machine-readable.
Category: Web Development (also: Apis, Analytics)
Author: Atomic Glue Team
## Definition
XML is a markup language that lets you define your own tags. Unlike HTML which has a fixed set of elements, XML has no predefined tags. You create the vocabulary your document needs. This extensibility made XML the foundation of countless data formats: RSS feeds, SVG (which is XML), SOAP APIs, Office documents (DOCX, XLSX are XML archives), and configuration files. XML is verbose. It uses opening and closing tags, namespaces for disambiguation, and attributes for metadata. It supports schemas (XSD) for validation, XPath for querying, and XSLT for transformation. XML dominated the web in the 2000s but has been largely supplanted by [JSON](/glossary/json) for API data exchange. However, XML is far from dead. It is deeply embedded in enterprise systems, publishing workflows, and document-centric applications.
## How it works
XML documents must be well-formed (proper nesting, one root element) and can be validated against a schema (XSD or DTD). Elements can contain text, other elements, or both (mixed content). Attributes provide metadata on elements. Namespaces prevent name collisions when combining XML from different sources. The DOM API used by browsers works identically for XML and HTML.
## When to use XML over JSON
Use XML when you need mixed content (text with embedded markup), document validation via schemas, namespace support, or transformation pipelines (XSLT). XML is still the standard for publishing (DocBook, TEI), configuration (Android manifests, Ant builds), and SOAP-based enterprise services.
## Common misconception
XML is not outdated. It is specialized. JSON replaced XML for API data exchange because JSON is simpler and natively maps to programming language data structures. But JSON cannot do what XML does for documents. If your use case involves complex document structures, schemas, or transforms, XML is still the right tool.
## Note
XML entity encoding is similar to HTML: `<` becomes `<`, `>` becomes `>`, `&` becomes `&`. Unlike HTML, XML requires all tags to be closed and attributes to be quoted. It is strict by design.
## In code
## Common questions Q: What is the difference between XML and HTML? A: HTML has a predefined set of tags for web content. XML lets you define your own tags. HTML is more forgiving of errors; XML is strict. Q: Is XML still used? A: Yes. XML is widely used in enterprise systems, publishing, configuration files, and document formats (SVG, DOCX, XLSX).
## Key takeaways
- XML is an extensible markup language with no predefined tags.
- XML excels for documents, schemas, and transformation pipelines.
- JSON has replaced XML for most web APIs, but XML is essential in many domains.
## Related entries
- [JSON](atomicglue.co/glossary/json)
- [SVG](atomicglue.co/glossary/svg)
- [HTML](atomicglue.co/glossary/html)
- [API](atomicglue.co/glossary/api)
Last updated June 2026. Permalink: atomicglue.co/glossary/xml