When I set a value of a text node with
node.nodeValue="string with &#xxxx; sort of characters"
ampersand gets escaped. Is there an easy way to do this?
You need to use Javascript escapes for the Unicode characters:
node.nodeValue="string with \uxxxx sort of characters"