What Is XML? Simple Explanation, Examples and Uses
XML stands for Extensible Markup Language. It is a text-based format used to structure, store and transport data in a way that both humans and machines can read.
- XML stores structured data.
- XML uses custom tags.
- XML is readable by humans and software.
- XML is commonly used in feeds, APIs and enterprise systems.
What does XML mean?
XML stands for Extensible Markup Language. It was designed to store and transport structured information.
Unlike HTML, XML does not focus on how content looks. Instead, XML focuses on describing the data itself.
Simple XML example
Here is a simple XML document:
<book>
<title>How to Clean Floors</title>
<author>Jane Smith</author>
<year>1922</year>
</book>
Each value is wrapped inside a tag. The opening tag, content and closing tag together form an XML element.
How XML works
XML uses a tree structure with parent and child elements.
<company>
<employee>
<name>Jane Smith</name>
<role>Senior Floor Cleaner</role>
</employee>
</company>
XML documents normally contain one root element with nested child elements.
What is XML used for?
| Use case | Example |
|---|---|
| Data exchange | Sending structured data between systems |
| Configuration files | Application and software settings |
| Web feeds | RSS and Atom feeds |
| Enterprise systems | SOAP services and older business integrations |
XML vs HTML
| XML | HTML |
|---|---|
| Stores and transports data | Displays content in a browser |
| Uses custom tags | Uses predefined tags such as <h1> and <p> |
| Strict syntax rules | Browsers are usually more forgiving |
XML vs JSON
XML and JSON are both structured data formats. JSON is often shorter and commonly used in modern web APIs, while XML supports attributes, namespaces and schema validation.
Read more: XML vs JSON
Common XML mistakes
- Missing closing tags
- Invalid nesting
- Multiple root elements
- Case sensitivity issues
<name>Jane</Name>
The example above is invalid because XML is case-sensitive. <name> and </Name> do not match.
Format or view XML online
Paste your XML into CheeseBridge tools to format, validate and inspect your XML.
Open XML Formatter Open XML ViewerTrusted XML references
For official and technical references, see:
Frequently asked questions
Is XML still used?
Yes. XML is still used in enterprise software, feeds, integrations, document formats and configuration systems.
Is XML a programming language?
No. XML is a markup language used to structure and describe data.
Can XML be converted to JSON?
Yes. XML can often be converted into JSON structures, although attributes, namespaces and repeated elements need to be handled carefully.