When serializing to BLOB or VARBYTE, you can specify the desired encoding for the serialization. If any of the data in the document cannot be represented in the specified encoding, a character translation error will occur.
SELECT XMLSERIALIZE(DOCUMENT customerXML AS BLOB ENCODING "UTF-8" WITH BOM INCLUDING XMLDECLARATION) FROM customer WHERE customerID = 1;