Remove trailing whitespaces from XML data