# What is XML?

> XML (Extensible Markup Language) is a markup language that defines rules for encoding structured documents using nested tags, attributes, and text content.

- URL: https://www.browserutils.dev/glossary/xml
- Published: 2026-03-21
- Updated: 2026-03-16

---

**XML (Extensible Markup Language)** is a markup language that defines rules for encoding structured documents using nested tags, attributes, and text content. Standardized by the W3C in 1998, XML provides a strict, self-describing format for representing complex data hierarchies and remains the backbone of SOAP, RSS, SVG, Office Open XML, and many configuration and document interchange formats.

## Structure and syntax

XML documents consist of elements (tags), attributes, and text content. Every document must have exactly one root element, and every opening tag must have a matching closing tag.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
  <book category="fiction">
    <title>Neuromancer</title>
    <author>William Gibson</author>
    <year>1984</year>
  </book>
</bookstore>
```

XML is strict about well-formedness: tags must be properly nested, attribute values must be quoted, and special characters (`<`, `>`, `&`) must be escaped as entities (`&lt;`, `&gt;`, `&amp;`).

## Where XML is still used

While JSON has replaced XML for most web APIs, XML remains dominant in several domains:

- **Enterprise systems**: SOAP web services, XML-RPC, and many banking/financial APIs still use XML exclusively.
- **Document formats**: XHTML, SVG, RSS/Atom feeds, EPUB, and Office Open XML (`.docx`, `.xlsx`) are all XML-based.
- **Configuration**: Java ecosystem configs (Maven `pom.xml`, Spring, Android manifests), `.csproj` files in .NET.
- **Data standards**: Healthcare (HL7/FHIR), publishing (DITA, DocBook), and government data exchanges.

## XML vs. JSON

JSON is more compact, maps directly to programming language data structures, and is simpler to parse. XML supports namespaces, schemas (XSD), transformation (XSLT), and querying (XPath/XQuery) — features that matter in enterprise contexts but add complexity.

A JSON object `{"name": "Ada"}` is 15 characters. The XML equivalent `<name>Ada</name>` is 16 — but real-world XML with namespaces and attributes is far more verbose.

## Parsing approaches

- **DOM**: Loads the entire document into memory as a tree. Good for small files.
- **SAX/StAX**: Event-based streaming parsers. Better for large files.
- **XPath**: Query language for selecting nodes. `//book[@category='fiction']/title` selects all fiction book titles.

Format XML with the [XML Formatter](/tools/xml-formatter), reduce file size with the [XML Minifier](/tools/xml-minifier), or convert between formats with [JSON to XML](/tools/json-to-xml) and [XML to JSON](/tools/xml-to-json).