Fixed removing of unprintable characters to not include newlines for outputting to XML