Encode binary values in XML documents using base64 and add encoding="base64" attribute to corresponding elements.