There is a vanishingly small chance that the data contain ']]>'. In fact, this could be an issue, but I have only been working here for two days and I am sure that the first answer I get will be that it is so unlikely that it is considered impossible. But this data has a high sorrow factor if it is not handled correctly, so I will eventually bring that up.
I think that base 64 encoding is out of the question as it would be too slow.
In practical terms, getting the binary data wrapped in '<![CDATA
...]>' is probably the best option. Maybe for now, I can do that myself in preprocessing and get some traction on parsing these that way.
Thank you.