title: Convert string to boolean Mule4 Dataweave
body: <p>I have mule4 DW expression which I want to convert into boolean &quot;as boolean&quot; is not working somehow or may be I am just misplacing it.</p>
  <p>DW Expression:</p>
  <pre><code>%dw 2.0
  output application/java
  ns ns0 http://www.demandware.com/xml/impex/order/2006-10-31
  ---
  [{
      Id: (payload.ns0#order.ns0#&quot;custom-attributes&quot;.*ns0#&quot;custom-attribute&quot; filter(item) -&gt; (item.@&quot;attribute-id&quot; == &quot;sscAccountid&quot;)) [0],
      Marketing_Opt_in__c: (payload.ns0#order.ns0#&quot;custom-attributes&quot;.*ns0#&quot;custom-attribute&quot; filter(item) -&gt; (item.@&quot;attribute-id&quot; == &quot;newsLetterRegistration&quot;)) [0] //***This output I want to convert into Boolean***
      
  }]
  </code></pre>
  <p>XML Tag</p>
  <pre><code>&lt;custom-attribute attribute-id=&quot;newsLetterRegistration&quot;&gt;false&lt;/custom-attribute&gt;
  </code></pre>