1. How to send XML as payload of a method call

Unfortunately, at the time the XML-RPC spec was designed, support for namespaces in XML was not as ubiquitous as it is now. As a consequence, no support was provided in the protocol for embedding XML elements from other namespaces into an xmlrpc request.

To send an XML chunk as payload of a method call or response, two options are available: either send the complete XML block as a string xmlrpc value, or as a base64 value. Since the '<' character i string values is encoded as '&lt;' in the xml payload of the method call, the XML string will not break the surrounding xmlrpc, unless characters outside of the assumed character set are used. The second method has the added benefits of working independently of the charset encoding used for the xml to be transmitted, and preserving exactly whitespace, whilst incurring in some extra message length and cpu load (for carrying out the base64 encoding/decoding).