remove new lines before formatting XML