Understanding XML
The grandfather of structured documents.
Older than JSON, more rigorous than YAML, still everywhere.
What XML actually is.
XML — Extensible Markup Language — is a tree of nested elements. Every element has a tag name, optional attributes, and either text content or further elements inside. The grammar is small and unambiguous; everything reduces to a parseable tree.
Well-formed vs. valid.
Well-formed XML follows the syntax rules: every opening tag has a closing tag, attributes are quoted, ampersands are escaped. Valid XML conforms to a schema (DTD or XSD) that says which elements may appear where, with what attributes. The formatter only checks well-formedness — it can't tell you whether your tags are the right ones for your schema.
Indentation, attributes, and the comma trap.
Convention is two-space indentation, one element per line when an element has children. Attributes can stay on the same line as the opening tag, or wrap to the next line in attribute-heavy XML (SVG, OOXML). Watch for < and & inside text content — both must be escaped as < and &. The formatter does this for you on the way out.
Namespaces.
XML namespaces let two vocabularies share a document without colliding. The xmlns attribute declares a namespace, and a prefix like xsl:template ties a tag to that vocabulary. The formatter preserves namespaces on input but won't enforce that referenced prefixes are declared — that's the schema's job.
Where you'll still meet XML.
SVG, RSS and Atom feeds, Office Open XML (.docx / .xlsx / .pptx are zipped XML), Android layouts, SOAP web services, industry data formats (HL7 in healthcare, FpML in finance, ONIX in publishing), and most enterprise integration tooling. JSON has eaten the casual web, but XML still owns the high-stakes, schema-validated corners.