This is for internal calls only. It will make sure that internally
created XML strings are "UTF-8 safe".
It assumes the given string has no prolog. If the string is unicode,
it will be UTF-8 encoded and a prolog with a UTF-8 encoding
declaration will be added. If the string is a regular byte string,
then a prolog with no encoding declaration will be added.