RE the unwanted newlines, if the outputrecordlength is set to infinity all newlines are removed from the xml file. If you already have a file full of newlines, setting this and then re-opening and saving the file will remove all of the unwanted newlines aka carriage returns.
In the Editor:
Tools/Preferences
Click on the dialog's Advanced... button
scroll down the list to outputrecordlength
select it, click on the edit button
set it to infinity, it is 72 by default in my installation of the editor
Close
OK