I am using javascript to read an XML, and create an envelope before storing in database. While creating headers, I need to populate the element "created-by" with the value of current user.
let user = xdmp.getCurrentUser()
I tried something like below, but its not replacing the variable with the value.
let a = xdmp.unquote('<created-by>{user}</created-by>')
How could I pass variable to XML using Javascript?