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 eXist, use util:parse():
util:parse(concat("","<c>asdf</c>","))