code snippet to parse XML string into a valid MX message object