Formatting starts with XML validation
Toolmera parses the input as application/xml before formatting it. Malformed tags, broken nesting and other well-formedness errors are reported instead of silently producing misleading output.
After validation, the browser serializes the document and Toolmera adds readable indentation.