MSXML 3.0 UTF-8 konvert doc. to CString

I am using MSXML 3.0 in my CE application.
How can I convert a document (a pointer to an object with the IXMLDOMDocument interface) to a CString?
The reason is that I want to convert the CString object to an array of bytes in UTF-8 format which I later will send through a socket connection.
[302 byte] By [Divad] at [2007-11-20 10:15:41]
# 1 Re: MSXML 3.0 UTF-8 konvert doc. to CString
I think I have the answer.
I use loadXML to load the xml string (BSTR), but it has to be in UTF-16
I use get_xml to get a BSTR string that holds the whole xml-document. I assume that also is in UTF-16 encoding.
However if it in the processing instrution of the xml document is stated that
encoding="UTF-8", will that then automatically be changed to UTF-16 when I call get_xml? I hope not.

Another question.
I have dynamically created a xml document with createProcessingInstruction and insertBefore with encoding="UTF-8".
Then i called save and got a file which either is an ansi file or an UTF-8 I can't tell. Is it so that save can create UTF-8 file?
Divad at 2007-11-10 3:26:47 >