I am trying to replace some text in an XML element with new text which I need to wrap in CDATA.
asset = request.responseXML;
asset.getElementByTagName("url").textContent = newUrl;
newUrl needs to be wrapped in CDATA since it can contains special characters. How is this possible? I have tried the following but it doesn't work
asset.getElementByTagName("url").textContent = "<![CDATA[" + newUrl + "]]>";
