What is XML?
Short answer
XML (Extensible Markup Language) stores structured data in nested, named tags, optionally with attributes. It is verbose but very expressive, and it underpins formats like RSS, SVG, and many office and enterprise documents.
Data in nested tags
XML wraps data in tags you define yourself. Each element has an opening and closing tag, can contain other elements, and can carry attributes for extra detail. The result is a tree that describes both the data and its structure.
<user id="42">
<name>Ada</name>
<role>author</role>
</user>Elements vs attributes
Information can live as a child element, like <name>Ada</name>, or as an attribute, like id="42". Attributes suit small, simple metadata, while elements suit richer or repeating content.
Where XML is used
- RSS and Atom feeds
- SVG vector graphics, which are XML
- Office document formats and many configuration files
- Enterprise data exchange with schema validation (XSD)