Representing MIME data in type trees

The MIME Adapter accepts a datastream and produces a corresponding MIME stream for an output card, it then parses a MIME stream and creates a decoded datastream for an input card.

This datastream could contain binary data that needs encoding, for example, using Base64 or Quoted-Printable encoding. In addition, parts or all of the stream might need to be secured, either through S/MIME or PGP encoding.

Therefore, the input stream needs to contain not only the data, but the processing instructions that determine what to do with the various message parts.

The format of this data is largely XML-based, however, since the adapter can represent binary data, it is not well-formed XML.