In both XML(Document) and in the Javascript HTML DOM, CreateTextNode(value) creates a node where the value is encoded as text. `document.body.appendChild(document.createTextNode("Hello <b>World</b>"));` will append `Hello <b>World</b>` to the body. Not so in HAP. I would say that HAP's behavior is wrong. Fixing it would be quite a breaking change, but for 2.x I think it should be corrected.