Remove unnecessary whitespace from XML string