Instead of the overhead with saving binary as Base64, I was wondering if you could directly store double-byte binary streams into XML files, using CDATA, or commenting it out, or something?
The Nul character ( '\0' in C ) is not valid anywhere in XML, even as an escape ( & #0; ).