How do I embed eXcel documents or Word documents in XML? I understand that XML is text format but is there a way to encode the binaries into some format like how email attach binary image files as a multipart mime attribute?
The ascii characters used by the encoding are all valid XML text node characters so you don't even need to use CDATA sections. You can simply place the encoded result inside an element and the file will be well-formed. The encoding is described by RFCs 1421 and RFC 2045.
See http://info.internet.isi.edu/in-notes/rfc/files/rfc2045.txt (section 6.8)
See http://www.w3.org/PICS/refcode/Parser/javadocs/Package-w3c.tools.codec.html for the API and http://www.w3.org/PICS/refcode/Parser/ for information about obtaining the tools.