IndentXml UDF

IndentXml is a simple UDF that will "pretty print" an XML (or XML-like) document according to XML's tag nesting rules.  It's smart enough to handle CDATA blocks.  It does NOT parse the XML, it only does string manipulation, so the document need not be well formed, just follow XML's tag rules closely enough to format correctly.

  • Version 1.0.1: 2010-03-10 a minor tweak to handle tags that close themselves on the same line, but are not self-closed.  (same post)
  • Version 1: 2008-05-01 post