JS conversion for attributes, cdata, text nodes and comments'