Skip to content
yutils
Example

Input (minified XML)

<rss version="2.0"><channel><title>yutils</title><item><title>Hello</title></item></channel></rss>

Output (formatted)

<rss version="2.0">
  <channel>
    <title>yutils</title>
    <item>
      <title>Hello</title>
    </item>
  </channel>
</rss>

Note

Validity errors (e.g. mismatched tags) abort formatting up front. Great for inspecting RSS, SOAP, sitemap.xml safely.

Usage / FAQ

When to use

  • Inspect RSS / Atom feed XML at a glance
  • Format SOAP responses or WSDL definitions
  • Restore readability for sitemap.xml or OpenAPI XML exports
  • Tidy Android layout.xml or Ant build.xml
  • Prepare minified XML for debugging or docs

FAQ

Q.Does it format invalid XML?
A.No. Validity issues like mismatched tags are caught up front and formatting is aborted — safer than silent corruption.
Q.How are CDATA and comments handled?
A.`<![CDATA[...]]>` and `<!-- ... -->` are preserved exactly. Only indentation changes.
Q.What about XML namespaces?
A.`xmlns:ns="..."` attributes are kept intact. Only whitespace changes.
Fun facts
  • XML was published in 1998 by the W3C as a simplified version of SGML — cutting roughly 80% of SGML's features. The lighter spec made parsers far easier to write than SGML's, which is why XML adoption exploded.

    W3C — XML 1.0
  • XML defines just 5 predefined entities — `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&apos;`. Any other named entity must be declared in a DTD. That's why HTML's thousands of named entities don't work in plain XML — it's the strict design paying off.

    W3C — XML predefined entities
  • XML 1.1 (2004) is essentially unused — virtually every XML system stayed on 1.0. The features 1.1 added (broader control-character support, etc.) weren't worth the compatibility risk, so XML's 'forever 1.0' era has now run 25+ years.

    Wikipedia — XML versions