XML Linter and xmllint-style Validator

XML lint, XML linter and xmllint-style validation notes. Last updated July 28, 2026.

An XML linter checks whether a document is well-formed: one root element, matching opening and closing tags, valid nesting and escaped special characters. Formalint's XML formatter gives browser-based linting for everyday integration payloads, SOAP responses, feeds and configuration files.

Open the XML Formatter and Validator to lint and format XML in the browser.

Common XML Lint Errors

The most frequent XML lint failures are mismatched tag names, missing closing tags, unescaped ampersands, multiple root nodes and text that accidentally includes angle brackets. These are the same kinds of well-formedness problems developers often look for with xmllint.

<order>
  <id>1001</id>
  <status>paid</status>
</order>

When an XML Linter Helps

XML problems are often noisy because the real bug is several lines before the parser message. A missing close tag near the top of a feed can make a later field look broken, and one unescaped ampersand in a company name can stop a whole import job. Formatting first gives you predictable indentation, then linting tells you whether the document can be parsed at all.

For API work, use a linter before comparing two XML responses or converting XML to JSON. Clean indentation makes repeated nodes, attributes and text nodes easier to inspect, especially in SOAP envelopes, RSS feeds, sitemap files, vendor exports and older ERP integrations.

xmllint-style Checks vs XSD Validation

Formalint focuses on fast well-formed XML checks and readable formatting. It does not replace schema validation against a custom XSD or DTD. Use it first to make sure the document parses, then run schema validation when a vendor or API contract requires it.

XML Review Checklist

Before sending an XML payload to another system, confirm that there is exactly one root element, every opening tag has a matching closing tag, attributes are quoted, special characters are escaped and repeated child nodes are intentionally repeated. If a partner gives you an XSD, validate against that schema after the well-formed check passes.

Frequently Asked XML Lint Questions

Does XML linting guarantee an API will accept my payload? No. Linting confirms the XML is well-formed. The receiving API may still reject a valid XML document if required nodes, attribute values or schema rules are missing.

Is xmllint the same as formatting? No. Formatting changes readability. Linting checks whether the XML can be parsed without structural errors.

Related Formalint Pages

Use XML Formatter for the live tool, JSON Formatter after converting XML to JSON, and API Debugging Checklist when an XML integration fails in production.