Hi David,
If you use the DOM parser in your java mapping you will get the same exception that in the message mapping, you have to deal with the payload like byte stream. Check this document Java Mapping: To change the encoding type or replacing special characters.
Regards.