I have a variable in xQuery of type xs:string with the value of an encoded HTML snippet (the content of a twitter tweet). It looks like this:
Headline
In MarkLogic you can use the below query:
let $d := '<c>asdf</c>' return xdmp:unquote ($d)