in reply to XML output formatting

Hello, if you wont a granular control over spacing you can enjoy the ability of another module: XML::Twig that has a lot of nice controls about spacing, prettify and indentation.
Well, if have learned yet LibXML, and you wont only refine the spacing, pipe the output to this oneliner:
cat xmlpmonks.xml | perl -ne "use XML::Twig; $/=''; $t=XML::Twig->new( +keep_spaces=>1); $t->parse(<>) or die $!; $t->print;"
As you can see i'm using keep_spaces but there are also: discard_spaces, discard_all_spaces, discard_spaces_in and keep_spaces_in.

Hth L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.