Tidying xml

one of the things I hate about xml, is that without syntax highlighting its very hard to see which directives are commented and which live.

This is often a problem, when you are in root profile, on some tomcat box, and you are inspecting the server.xml for changes...

tidy
tidy -quiet -asxml -xml -indent -wrap 95 --hide-comments 1

xmlstarlet
xmlstarlet c14n --without-comments old.xml > new.xml

xmllint
<span style="color: rgb(0, 0, 0); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">xmlllint --format

sed
cat  | sed 's///' | sed '//d' http://www.prasannatech.net/2010/12/stripping-comments-xml-file.html