process XML data before pretty-printing to trim whitespace