title: How to embed CDATA in Mulesoft
body: <p>I'm trying to embed a literal CDATA value in a Mulesoft flow and cannot figure out how to do so.</p>
  
  <p>My desired output (in an HTTP request body) is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;soap:Body&gt;
          &lt;query xmlns="http://autotask.net/ATWS/v1_5/"&gt;
              &lt;sXML&gt;
                  &lt;![CDATA[&lt;queryxml&gt;&lt;entity&gt;ticket&lt;/entity&gt;&lt;query&gt;&lt;condition&gt;&lt;field&gt;id&lt;expression op="equals"&gt;12345&lt;/expression&gt;&lt;/field&gt;&lt;/condition&gt;&lt;/query&gt;&lt;/queryxml&gt;]]&gt;
              &lt;/sXML&gt;
          &lt;/query&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>My Dataweave transformation looks as follows:</p>
  
  <pre><code>%dw 1.0
  %output application/xml
  %namespace soap http://schemas.xmlsoap.org/soap/envelope
  ---
  {
      soap#Envelope @(version: "1.0") : {                  
          soap#Header: {},
          soap#Body: {
              query: {                
                  sXML: "&lt;queryxml&gt;&lt;entity&gt;ticket&lt;/entity&gt;&lt;query&gt;&lt;condition&gt;&lt;field&gt;id&lt;expression op=\"equals\"&gt;12345&lt;/expression&gt;&lt;/field&gt;&lt;/condition&gt;&lt;/query&gt;&lt;/queryxml&gt;"                     
              }
          }
      }
  }
  </code></pre>
  
  <p>But when I send this request to requestb.in (to inspect the contents), I can see it's coming through like this (focus on the sXML entity):</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope" version="1.0"&gt;
    &lt;soap:Header/&gt;
    &lt;soap:Body&gt;
      &lt;query&gt;     
        &lt;sXML&gt;&amp;lt;queryxml&gt;&amp;lt;entity&gt;ticket&amp;lt;/entity&gt;&amp;lt;query&gt;&amp;lt;condition&gt;&amp;lt;field&gt;id&amp;lt;expression op="equals"&gt;12345&amp;lt;/expression&gt;&amp;lt;/field&gt;&amp;lt;/condition&gt;&amp;lt;/query&gt;&amp;lt;/queryxml&gt;&lt;/sXML&gt;
      &lt;/query&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>How can I get a literal CDATA value in there via dataweave / MEL?</p>
  
  <p>Thank you.</p>