Control character in XML output

A non-space character less than hex 20 was encountered while generating XML content. Consider base64 encoding strings that contain control characters before using them as XML content. This can be accomplished in a FOR XML query or SQLX function by casting the string to a type such as LONG BINARY.