xml-format
Format an XML document. tldr-pages
On several platforms
Several platforms
Format an XML document, indenting with tabs
xml [fo --indent-tab path/to/input.xml >path/to/output.xmlIdentifyFormat an HTML document, indenting with 4 spaces
xml [fo --html --indent-spaces 4 path/to/input.html >path/to/output.htmlIdentifyRecover parsable parts of a malformed XML document, without indenting
xml [fo --recover --noindent path/to/malformed.xml >path/to/recovered.xmlIdentifyFormat an XML document from stdin, removing the DOCTYPE declaration
cat path/to/input.xml | xml [fo --dropdtd >path/to/output.xmlIdentifyFormat an XML document, omitting the XML declaration
xml [fo --omit-decl path/to/input.xml >path/to/output.xmlIdentifyDisplay help
xml [fo --helpIdentify