How to convert xml payload to a string in dataweave 2.0?
Thanks Vempati
The best way would be something like.
output application/java
---
payload.^raw as String
The .^raw
returns the underlying input stream then we transform it into a String
and return it as a Java Value so the payload is a java.lang.String
https://docs.mulesoft.com/mule-runtime/4.1/dw-core-functions-write
write(payload, "text/plain", {"encoding": "UTF-8"})