Formatting, minifying and checking XML
The document is first checked for well-formedness: every tag closed and properly nested, attribute values quoted, one root element. If that fails you get the line and column. If it passes, Format puts each element on its own line with the indentation you choose, and Minify removes the whitespace between tags.
Text content, attribute values, comments, CDATA sections and the XML declaration are written exactly as they came in. Only whitespace between tags changes.
XML to JSON
XML has attributes and mixed content, which JSON lacks, so a convention is needed:
<item sku="BOLT" qty="200">zinc</item>
{ "item": { "#text": "zinc", "@_sku": "BOLT", "@_qty": "200" } }Attributes get the prefix @_, text next to attributes or child elements goes under #text, and repeated sibling elements become an array. Values stay strings. This check is about well-formedness only: it does not validate against an XSD or DTD.
Send the JSON on to the JSON formatter to browse it as a tree.