How this tool works
The document is split at the boundaries between tags and re-indented, with two spaces added on entering an element and removed on leaving it. That produces a readable tree from a document that arrived as one unbroken line, which is how XML usually arrives from an API or an export.
This is a formatter rather than a parser: it re-indents structure it recognises, and it does not validate. A document with a missing closing tag or a mismatched name will be re-indented as happily as a correct one, with the fault showing up only as indentation that drifts in a direction it should not.
What it will and will not handle
- Nothing is validated: a malformed document produces malformed output rather than an error. Drifting indentation is often the first visible sign that something upstream is wrong.
- Text between tags may not survive tidily: the split works on tag boundaries, so mixed content — text with inline elements in it — is where the output is least reliable.
- Attributes are left exactly as they are: order, spacing and quoting inside a tag are untouched. Only the indentation between tags changes.
- Use it to read, not to rewrite: reformatted XML is for looking at. Feeding it back into a system that cares about whitespace is a risk this tool cannot assess for you.