xmllint
and tidy
can both format XML and HTML file.
Using their default versions On Ubuntu 14.04,
xmllint
is more reliable than tidy
regarding to
indentation correctness and Unicode conversion.
sudo apt install libxml2-utils
xmllint --format input.xml > output.xml
sudo apt install tidy
tidy -xml -i input.xml > output.xml