You might be thinking, "Duh, just escape it". Nope, ASCII control codes are forbidden you can't escape them, the escaped form is still forbidden. You can escape say, a backslash, or a quote mark, or an angle bracket, but you can't escape say a vertical tab.
So if you want to move arbitrary ASCII text (or Unicode text, since ASCII is a subset of Unicode) with XML you need to Base64 encode it, or you won't succeed.
15-20 years ago I wrote code which needed to square this particular circle where clients insisted that they want XML text and yet they also demand to handle the forbidden values, my code would just convert all impermissible values to Unicode's U+FFFD the Replacement Character.