title: Mule Dataweave: using dynamic key while transforming json to xml
body: <p>I am trying to use Mule dataweave transformer to transform a JSON to an XML. One of the key name of the JSON payload is dynamic and it depends on the input you provide to the JSON payload. Please look at the <a href="https://github.com/mule-examples/json-to-xml/blob/master/src/main/app/json-to-xml.xml#L40" rel="nofollow">line #40</a> where I am using</p>
  
  <pre><code>value: payload.quotes.INR.midpoint
  </code></pre>
  
  <p>to parse the data. <strong>INR</strong> is basically the target currency of the payload and the target currency value is <a href="https://github.com/mule-examples/json-to-xml/blob/master/src/main/app/json-to-xml.xml#L39" rel="nofollow">line #39</a>:</p>
  
  <pre><code>target_currency: payload.meta.effective_params.quote_currencies[0]
  </code></pre>
  
  <p>So while assigning the <strong>value</strong> I want to use something like this:</p>
  
  <pre><code>value: payload.quotes.($(payload.meta.effective_params.quote_currencies[0])).midpoint
  </code></pre>
  
  <p>Is this possible at all with Mulesoft dataweave transformer? Or, if not, then can you please suggest any neat solution?</p>