in reply to Re: Beautifying some SGML? (XML)
in thread Beautifying some SGML?

It is a feature. As JavaFan mentioned before, adding whitespace is a bit risky, as you have to make sure that it is non-significant. So xml_pp adds line returns and indentation in-between tags if there is no other data in the element. This is not guaranteed to be perfectly safe, but as in general the DTD is unavailable, that's about the best it can do. As soon as there is non-whitespace data in the element, then no indentation is added. Because according to the XML spec, in that case the whitespaces ARE significant.

It would be possible to add extra options to control more precisely the behavior of xml_pp, but that would be quite tricky, and error prone. At this point it's easier to write a custom pretty printer for your data. At least it's easier for me! ;--)