Contact Free trial Login

XML to Object Transformer Reference

MuleSoft recommends against deployments to Mule 3.8. Standard Support for this version ended on November 16, 2018, and Mule 3.8 will reach its End of Life on November 16, 2021, when Extended Support ends.

You can use an XML to Object transformer to transform XML data to a Java Object (also referred to as Java Bean graphs) using XStream.

Minimum Configuration: The name of the XStream driver class.

An XML-to-Object transformer transforms XML data using the specified XStream driver class.

Important: Mule uses XStream 1.4.2. The XML-to-object transformer is vulnerable to CVE-2013-7285. A remote attacker can send messages to an XML to Object transformer and can achieve remote code execution (RCE). For more information, contact MuleSoft Customer Support.

In addition to the properties common to all transformers, you can also specify class aliases and converters.

Configuring XML to Object


  • General - Specify or browse to the XStream driver class:

  • Advanced - Optionally configure the properties standard to all transformers, plus add or change class aliases and class converters.

    • Use the Aliases pane to create, edit, or delete aliases for specific classes.

    • Use the Converters pane to create, edit, or delete class converters.

Code Example

The following example converts XML to Object passed to Groovy for processing. The results are logged.

xml to object ref
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:scripting=""

    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
    <flow name="Catalog_DownloaderFlow1" >
        <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
        <mulexml:xml-to-object-transformer doc:name="XML to Object"/>
        <scripting:component doc:name="Groovy">
            <scripting:script engine="Groovy" file="myScript.groovy"/>
        <logger level="INFO" doc:name="Logger"/>

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub