Reformat and reindent an XML file #xml This is easy to accomplish with xmllint and a shell one-liner: xmllint --format inputfile.xml > outputfile.xml