Formatting & Indentation

How XML Indentation Works
Why whitespace between elements is usually ignored, when it isn't, and how formatters pretty-print XML.
Read guide →
Format XML in Python
minidom, ElementTree.indent, and lxml — complete code examples for pretty-printing XML.
Read guide →
Format XML in JavaScript
DOMParser, XMLSerializer, and a recursive pretty-printer for Node.js and the browser.
Read guide →

Validation & Errors

How to Check XML Syntax
Well-formed vs valid, how to check XML in the browser, with xmllint, in Python, and the errors that break it.
Read guide →

Minification & Comparison

How to Minify XML (and When You Shouldn't)
What's safe to strip, why whitespace inside elements is risky, and how much size you actually save.
Read guide →
Comparing Two XML Files: A Guide to XML Diffing
Why a text diff fails for XML, what a structure-aware diff shows, and how to compare programmatically.
Read guide →

Querying XML

XPath Tester: How to Test XPath Online
XPath syntax basics, axes and predicates, common expressions, and how to evaluate them in the browser.
Read guide →