How to format and indent xml file, Ubuntu, Linux Written by Krzysztof Dryja on January 26, 2013 in IT Stuff There’s a very simple way to format and indent ugly.xml file to pretty.xml in Ubuntu Linux: How to format and indent XML file xmllint --format ugly.xml --output pretty.xml 1 xmllint --format ugly.xml --output pretty.xml Simple, isn’t it?