What exactly does the minifier strip out of my XML?
Three things. First, whitespace between elements (the indentation and blank lines you added for readability). Second, XML comments (<!-- ... -->) — they carry no semantic value at runtime. Third, redundant whitespace inside tags themselves. The minifier never alters element names, attribute values, or text content.
Are CDATA sections preserved?
Yes. Anything inside <![CDATA[ ... ]]> is treated as opaque content — the parser hands it through to the serializer untouched. CDATA is the standard XML escape hatch for embedding HTML, JSON, code, or significant whitespace, so the minifier deliberately leaves it alone.
How much size reduction should I expect?
Typical reductions are 20–40%. Heavily-indented configuration files (Spring, log4j) tend toward the high end because every nested element carries 4–8 spaces of indent. Data-dense XML (RSS feeds, SOAP responses) sits at the lower end because most of the bytes are actual content. Add gzip on top and you reach 70–85% over the original.
Will minification ever break my XML?
No. The minifier parses your input through DOMParser before serializing — if the round-trip succeeds, the output is well-formed XML by construction. Whitespace inside attribute values and text nodes is preserved exactly, so anything semantically significant survives.
Why minify XML when gzip already compresses it?
Three reasons. First, not every transport gzips: some legacy SOAP middleware, message buses, and embedded device protocols send raw bytes. Second, smaller raw XML parses faster — the DOM tree built from minified input has fewer text nodes. Third, billing on per-byte API gateways (AWS API Gateway, Azure API Management) charges for the wire size after gzip but before transport, so minification still saves money.
Does removing comments matter for production?
In a production payload, almost never — XML parsers ignore comments by default. Strip them to save bytes. Keep them only if your tooling specifically reads comments (some XSLT pipelines and signed-XML workflows do).
Can I un-minify the output later?
Yes. Run the minified XML through the XML Formatter tool on this site to restore indentation. The semantic content is identical to the original — only the layout was lost — so the round-trip is lossless for everything except the comments you stripped.
Is my XML uploaded anywhere?
No. The minifier runs in JavaScript on your machine using the browser's built-in DOMParser and XMLSerializer. Open DevTools → Network and confirm: clicking Minify produces zero network requests. Safe for SOAP envelopes that contain credentials, signed payloads, or PII.