USA Data Tools

What Is XML?

XML stands for Extensible Markup Language. It is a text format that uses named tags to describe structured data for integrations, documents, feeds, configuration files, and enterprise systems.

XML in plain language

XML wraps values in opening and closing tags. A tag name describes what the value means, and tags can be nested inside other tags.

<order>
  <poNumber>123456</poNumber>
  <customer>ACME Warehouse</customer>
  <item>
    <sku>ABC123</sku>
    <quantity>10</quantity>
  </item>
</order>

A full XML file example

This example represents one purchase order. The root element is <order>, and the child elements describe the purchase order number, ship-to location, and item lines.

<order id="123456">
  <orderDate>2026-05-05</orderDate>
  <shipTo>
    <name>ACME Warehouse</name>
    <city>Dallas</city>
    <state>TX</state>
  </shipTo>
  <items>
    <item line="1">
      <sku>ABC123</sku>
      <quantity>10</quantity>
      <unitPrice>15.25</unitPrice>
    </item>
    <item line="2">
      <sku>XYZ789</sku>
      <quantity>4</quantity>
      <unitPrice>7.50</unitPrice>
    </item>
  </items>
</order>

The main parts of XML

Elements are the named areas of an XML document. An element usually has an opening tag, content, and a closing tag. In the example, <order>, <poNumber>, <customer>, and <item> are elements.

Tag names describe the kind of data inside the element. A clear tag name such as <trackingNumber> or <shipTo> helps a person and a system understand the business meaning of the value.

Text values sit between an opening tag and closing tag. In <sku>ABC123</sku>, the value is ABC123.

Attributes are optional name and value pairs inside an opening tag. For example, <item line="1"> has an attribute named line with the value 1.

Highlighted XML parts

Element example: the blue opening tag, value, and closing tag make one complete element.

<city>Dallas</city>

Tag name example: the yellow tag name says what kind of data is inside the element.

<quantity>10</quantity>

Text value example: the green text is the value stored inside the tags.

<sku>ABC123</sku>

Attribute example: the pink name and value sit inside the opening tag and add detail about the element.

<item line="1">
  <sku>ABC123</sku>
</item>

How to read an XML document

Start with the root element, which is the outer wrapper for the document. Then read the child elements inside it. Nested elements usually represent a smaller business area, such as one item inside an order or one address inside a shipment.

XML is often more wordy than JSON, but the repeated tag names make the structure explicit. That can be helpful when different systems need strict names, schemas, namespaces, or validation rules.

Why teams still use XML

Many enterprise, banking, government, logistics, healthcare, and older integration systems still exchange XML. XML can be validated against schemas and can represent complex nested data in a predictable way.

Why XML formatting and comparison matter

Compact XML can be difficult to read. Formatting makes nested tags easier to inspect. Comparing XML payloads helps identify changed tags, missing elements, extra nodes, and value changes during testing.

USA Data Tools includes a browser-local XML formatter and payload comparison workspace for integration teams.