I want to create an xml file which have '&' in one of its text node. like
<url>www.sample.com/where/values?firstvalue=1&secondvalue=2</url>
Now what I am getting is
<url>www.sample.com/where/values?firstvalue=1&secondvalue=2</url>
Could you please let me know how can I achieve that. I am attaching the url value to dom using contenturl.appendChild(doc.createTextNode(model.getDocURL()));
and I am parsing using following method
DOMSource source = new DOMSource(doc);
transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(source, result);