In SQL Server the default conversion from the xml type to varbinary uses XML text encoding (start and end tags with angled brackets etc) using UTF-16 character encoding. E.g.
declare @xml xml = '<foo><bar>abc</bar></foo>';
declare @foo varbinary(max);
set @foo = CONVERT(varbinary(max), @xml, 2);
select @foo
Yields:
0xFFFE3C0066006F006F003E003C006200610072003E006100620063003C002F006200610072003E003C002F0066006F006F003E00
Notice the zeros, indicating the double byte characters. Is there a way to convert into UTF-8?