I can never get the tidy tool work as well as the (admittedly heavier) XML::Tidy perl module. Here's a little script I keep around as a better way to tidy up XML.
#!/usr/bin/perl
use strict;
use XML::Tidy;
my $src = shift @ARGV
or die "USAGE: $0 <xmlin> (-|<xmlout>)";
my $out = shift @ARGV;
my $tidy = XML::Tidy->new('filename' => $src);
$tidy->tidy("\t");
$out or print $tidy->toString();
if ($out eq '-') { $tidy->write() } # overwrite
else { $tidy->write($out) }
