XML Guides & Reference
Practical guides for understanding and working with XML — from indentation and syntax to real-world tooling like XPath and diffing.
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
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 →