What this tool does
Element content gets indented; text content does not.
<library><book><title>Dune</title></book></library>
becomes
<library>
<book>
<title>Dune</title>
</book>
</library>
The rule that matters
An element that mixes text and child elements is left on a single line, exactly as written.
<p>Hello <b>world</b> again</p>
That stays as it is. The reason is the difference between XML and HTML that catches the most people: HTML collapses whitespace, XML does not. A line break inserted between Hello and <b> is not presentation in XML — it is character data, and it stays in the document for whoever reads it next.
So a formatter that indents inside mixed content is not making the document prettier; it is editing the text. This one indents the element as a block and leaves its inside alone.
What counts as indentation
Only a text node that is entirely blank, that contains a line break, and that sits in an element holding no significant text of its own. Everything else is content.
A single space between two elements on the same line — <b>x</b> <i>y</i> — is kept. Nothing in the document says it is negligible, and keeping it costs one character.
xml:space="preserve" suspends all of it, for that element and everything under it.
The prolog comes back as you wrote it
The declaration, the DOCTYPE and any processing instruction are copied verbatim:
<?xml version="1.1" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE library SYSTEM "library.dtd">
<?xml-stylesheet href="style.xsl"?>
All three survive. Rewriting a declaration to version="1.0" encoding="UTF-8" — which is what many tools do — relabels the document, and relabelling changes how its bytes are read.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.