issue with newlines and spaces in formatted xml fixed