Depends on the exact situation - I will assume you are talking about something like a message hub, where you want data to be synchronizing between X systems.
1) for data coming OUT of CRM, you can use plugins - trigger them on Create/Update of a record, and within the plugin translate the record's data into your desired XML (perhaps using classes generated with XSD.exe and a schema file) and send that XML
to the desired queue/endpoint/receiver
2) for data coming IN to CRM, that does not really fit the plugin model currently. What you need to do is parse the incoming XML and then issue the appropriate CRM SDK calls to create the record. (BizTalk WCF Adapter, custom web services, SSIS packages,
etc)
You could attempt to create an attribute on the entity called 'inputXML' or something and use that to just pass in the XML there and parse it in the Create plugin but the problem is you will pretty quickly hit the maximum size of a field in CRM
as your XML grows.