What Is XML?
Learn what XML is, how to read elements and attributes in a sample feed, and what to check before keeping XML or converting it to JSON.

Start with a file you can recognize
XML, short for Extensible Markup Language, is a text format that labels data with nested elements. A shipping partner might send an XML feed in which a shipment contains several package elements. The element names describe the structure; the partner's documentation tells you what each field means. Opening the file in a text editor lets you inspect those labels without importing it into an application.
Before you convert the file, find the record your team works with. If a support agent looks up a shipment, that record is the shipment. If an operations analyst counts packages, the package is the record, and its shipment ID must travel with it.
Read the three parts of a small feed
<shipments>
<shipment id="0042">
<destination>Depot A & B</destination>
<package code="P01" units="2"/>
<package code="P02" units="3"/>
</shipment>
</shipments>
shipments is the root element. It encloses the feed. shipment is a child element and contains the destination and packages. id, code and units are attributes: values attached to specific elements. The destination text reads “Depot A & B”; the file represents the ampersand as & so it is not mistaken for the start of another reference.
This example has one shipment, two packages and five units. Those are three different counts. A converter can produce correctly formatted output that is still wrong for your task if it drops a package or treats the shipment ID as a number.
Decide which format the receiver actually needs
| The receiver needs | Keep or produce | Check first |
|---|---|---|
| A documented integration that expects the original feed contract | XML | Element names, namespace if used, and required fields |
| An application that expects nested objects | JSON | Package list stays an array even when there is only one package |
| A report with one row per package | A flat table | Each row includes the parent shipment ID |
Don't change formats simply because one looks easier to read. If the receiving application specifies XML, keep the original and make a separate review copy. If the output goes to a report, write down whether a row represents a shipment or a package before you build the report.
Separate readable XML from acceptable business data
Matching start and end tags and a single root are checks on syntax. A schema or integration agreement can impose additional rules. The file may parse correctly while missing the destination your receiving application requires. It may also contain a perfectly valid package code that your team no longer uses.
Ask three questions in order: Can a parser read it? Does it conform to the sender's agreed structure? Can the receiver use the values? If the first check fails, fix the source or request a new export. If the third fails, report the field and a representative record to the owner instead of inventing a default.
Verify the mapping before handing over a conversion
Use a small copy with one multi-package shipment and one single-package shipment. Record the expected number of shipments and packages. If your downstream system needs five units for shipment 0042, compute two plus three from the original and verify the same total afterward. Search for 0042, not 42; the zeroes are part of this identifier.
Next, check a missing destination and an empty destination as separate cases. Keep them distinct when the receiving system uses the difference. A readable output is not a completed handoff until its counts, IDs and expected blank values match your notes.
Questions about XML files
Is XML the same thing as HTML? No. Both use markup syntax, but HTML describes a web document using a defined vocabulary. An XML feed can define elements for a business contract, such as the shipments and packages above.
Does every XML file include a schema? No. Ask the provider how its format is documented. You can inspect the basic structure without a schema, but you cannot infer all the provider's required fields from one sample.
Inspect a safe sample in the converter
If your receiving application asks for JSON, start with the synthetic shipment sample above, then compare the result with your record counts. Use the preview to inspect the mapping rather than assuming that every converter represents attributes and repeated elements the same way. Do not paste a live shipment feed containing customer details.

