title: Using XML Transformer in Mule
body: <p>I currently receive a string message from a queue, The string message contains XML. How do I pick each element and convert to a POJO. This is the content of my queue</p>
  
  <pre><code>&lt;MsgContent&gt;
     &lt;MsgHeader&gt;
         &lt;code&gt;1010&lt;/code&gt;
     &lt;/MsgHeader&gt;
     &lt;MsgBody&gt;
          &lt;value&gt;fundstransfer&lt;/value&gt;
     &lt;/MsgBody&gt;
  &lt;/MsgContent&gt;
  </code></pre>
  
  <p>I want to be able to get the values of the two keys(code and value)</p>
  
  <p>This is my mule configuration xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
      &lt;mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:data-        mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper"          xmlns:xm="http://www.mulesoft.org/schema/mule/xml"  xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:file="http://www.mulesoft.org/schema/mule/file"   xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-current.xsd
      http://www.mulesoft.org/schema/mule/xml  http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
      http://www.mulesoft.org/schema/mule/core  http://www.mulesoft.org/schema/mule/core/current/mule.xsd
      http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
      http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
      http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
      http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd"&gt;
     &lt;jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/&gt;
  
  &lt;mulexml:jaxb-context name="myJaxb" doc:name="myJaxb" packageNames="com.test.jaxb" /&gt;
  &lt;flow name="JMSMessageFlow1" doc:name="JMSMessageFlow1"&gt;
      &lt;jms:inbound-endpoint queue="StudioIns" connector-ref="Active_MQ" doc:name="JMS" /&gt;
      &lt;custom-transformer class="org.mule.module.xml.transformer.XmlToXMLStreamReader" /&gt;
      &lt;mulexml:jaxb-xml-to-object-transformer  jaxbContext-ref="myJaxb" returnClass="com.test.jaxb.MsgContent"/&gt;
      &lt;component class="com.test.HelloMessage" doc:name="Java"/&gt;
      &lt;file:outbound-endpoint path="D:\Documents\MuleStudio\workspace\jmsmessage\src\main\java\com\test" outputPattern="output.csv" responseTimeout="10000" doc:name="File"/&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p></p>
  
  <p>But still can't retrieve the objects</p>