How to pretty print XML from the command line?
xmllint This utility comes with libxml2-utils: echo ‘<root><foo a=”b”>lorem</foo><bar value=”ipsum” /></root>’ | xmllint –format – Perl’s XML::Twig This command comes with XML::Twig perl module, sometimes xml-twig-tools package: echo ‘<root><foo a=”b”>lorem</foo><bar value=”ipsum” /></root>’ | xml_pp xmlstarlet This command comes with xmlstarlet: echo ‘<root><foo a=”b”>lorem</foo><bar value=”ipsum” /></root>’ | xmlstarlet format –indent-tab tidy Check the tidy package: echo … Read more