in reply to Scrubbing XML

If you can do without any newlines at all:
s/\s+/ /g;
"\s" includes \r and \n.