Extensible Markup Language (XML)

What Is Extensible Markup Language (XML)?

Extensible Markup Language (XML) is a text-based markup language designed to encode structured data in a format that is both human-readable and machine-processable. Developed by the World Wide Web Consortium (W3C) and published as a formal recommendation in February 1998, XML was derived from the Standard Generalized Markup Language (SGML, ISO 8879) and designed specifically for data interchange over networks and document storage. Unlike HTML, which uses a fixed set of tags for presentation, XML allows authors to define their own tag names, making the language extensible across any domain that needs to represent structured information.

An XML document consists of nested elements, each bounded by a start tag and end tag, forming a tree-hierarchical structure with a single root element. Attributes attached to elements carry metadata, and a Document Type Definition (DTD) or XML Schema (XSD) can constrain the permitted structure and data types. The W3C XML specification was designed around ten design goals, prominently including Internet usability, broad applicability, and the principle that optional features should be kept to an absolute minimum to prevent divergent implementations.

Document Structure and Well-Formedness

XML imposes strict syntactic rules that must be satisfied for a document to be considered well-formed. Every start tag must have a matching end tag; elements must be properly nested, never overlapping; attribute values must be quoted; and a single root element must enclose all other content. These rules, stricter than those of HTML, enable generic parsers to process any XML document without domain-specific knowledge. The W3C XML Activity page describes the core specification and the family of related standards maintained around it, including XSLT for transforming XML documents, XPath for addressing parts of a document, and XQuery for querying XML data stores.

The distinction between well-formed and valid XML is significant. A well-formed document meets basic syntactic requirements. A valid document additionally conforms to a declared schema that specifies which elements and attributes are permitted, in what order, and with what data types. Schema validation is the mechanism by which trading partners in a data exchange agreement ensure that documents meet the agreed-upon structure before processing.

XML became the foundation for a broad ecosystem of related standards and document formats. XHTML reformulated HTML 4 as an XML vocabulary, imposing stricter parsing rules. SVG (Scalable Vector Graphics) and MathML encode vector graphics and mathematical notation as XML. Office Open XML and ODF (Open Document Format) represent word processing and spreadsheet documents as XML archives. SOAP, the protocol underlying early web services, encodes remote procedure calls as XML messages transported over HTTP.

The original W3C XML 1.0 Recommendation of 1998 remains a definitive primary source, documenting the syntax, character encoding requirements, and namespace model that all conforming parsers must implement. The Namespaces in XML specification, published the following year, extended the core standard to allow elements from multiple vocabularies to coexist unambiguously in a single document by associating each element name with a URI-identified namespace.

AWS's technical overview of XML and its role in data interchange describes how XML underpins configuration management, API message formats, and cross-platform data exchange in enterprise and cloud environments, noting that while JSON has displaced XML for many web API uses, XML remains dominant in document-centric applications, financial messaging standards such as FIX and ISO 20022, and healthcare data exchange formats such as HL7 CDA.

Applications

XML has applications in a wide range of fields, including:

  • Healthcare data exchange using HL7 and CDA document standards
  • Financial messaging and securities transaction processing
  • Configuration management files for enterprise software
  • Publishing and document management systems
  • Geospatial data encoding through the OGC Geography Markup Language (GML)
Loading…