Hi Martin,
When the "encoding" attribute is ommited in the XML declaration, UTF-8 or UTF-16 is assumed. Exactly what depends on the BOM of the file.
STRTOFILE() saves the file ANSI encoded. In order to write the byte stream in UTF-8, try to use the STRCONV() function with the value "9" in the second parameter, as shown here:
STRTOFILE(STRCONV(lcXml,9), 'Test.xml', 0)
The value "9" in the second parameter converts the string from DBCS to UTF-8
Regards,