Including binary data in an XML

All data in XML need to be characters. So, if you want to store binary data in an XML, you would have to encode it first. One way to do this is with Base64. So, you could have an XML file like the following:

      <body type="Base64">base64encodedbytearray</body>

For more information, check out this JavaWorld tip.