title: how to achive expected output using DataWeave with data from a string inside a JSON
body: <p>How to transform json data as shown in input into XML as shown in output using MuleSoft's DataWeave language.</p>
  <p>Input</p>
  <pre><code>{
      &quot;sponsors&quot;:[{
          &quot;SP1&quot;: &quot;John Smith&quot;,
          &quot;NINO&quot;: &quot;SC105012B&quot;,
          &quot;INCOME1&quot;: 10000,
          &quot;INCOME2&quot;:12000,
          &quot;DEPENDENTDETAILS&quot;: &quot;No, FirstName, LastName, DateOfBirth, EduStatus, Income; 1, John, Smith, 12/12/84, studying at college or university, yes; 2, williams, Smith, 20/06/84, studying at college or university, No;&quot;
      }]  
  }
  </code></pre>
  <p>Expected Output</p>
  <pre><code>&lt;sponsors&gt;
      &lt;sp1&gt;john smith&lt;/sp1&gt;
      &lt;nino&gt;sc15012b&lt;/nino&gt;
      &lt;income1&gt;10000&lt;/income1&gt;
      &lt;income2&gt;12000&lt;/income2&gt;
      &lt;dependentdetails&gt;
          &lt;no&gt;1&lt;/no&gt;
          &lt;firstname&gt;john&lt;/firstname&gt;
          &lt;lastname&gt;smith&lt;/lastname&gt;
          &lt;dateOfBirth&gt;12/12/84&lt;/dateOfBirth&gt;
          &lt;EduStatus&gt;studying in college or university&lt;EduStatus/&gt;
          &lt;Income&gt;yes&lt;/Income&gt;
          &lt;no&gt;2&lt;/no&gt;
          &lt;firstname&gt;williams&lt;/firstname&gt;
          &lt;lastname&gt;smith&lt;/lastname&gt;
          &lt;dateOfBirth&gt;20/06/84&lt;/dateOfBirth&gt;
          &lt;EduStatus&gt;studying in college or university&lt;EduStatus/&gt;
          &lt;Income&gt;No&lt;/Income&gt;
      &lt;/dependentdetails&gt;
  &lt;/sponsors&gt;
  </code></pre>