title: How to avoid encoding of <,>,& with Document.createTextNode
body: <pre><code>class XMLencode 
  {
    public static void main(String[] args) 
    {
      try{
  
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = factory.newDocumentBuilder();
      Document doc = docBuilder.newDocument();
      Element root = doc.createElement("roseindia");
         doc.appendChild(root);
      Text elmnt=doc.createTextNode("&lt;data&gt;sun&lt;/data&gt;&lt;abcdefg/&gt;&lt;end/&gt;");
         root.appendChild(elmnt);
       TransformerFactory tranFactory = TransformerFactory.newInstance(); 
      Transformer aTransformer = tranFactory.newTransformer(); 
      Source src = new DOMSource(doc); 
      Result dest = new StreamResult(System.out); 
      aTransformer.transform(src, dest); 
  
      }catch(Exception e){
       System.out.println(e.getMessage());
           }
       }
  }
  </code></pre>
  
  <p>Here is my above piece of code.
  The output generated is like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&lt;roseindia&gt;&amp;lt;data&amp;gt;sun&amp;lt;/data&amp;gt;&amp;lt;abcdefg/&amp;gt;&amp;lt;end/&amp;gt;&lt;/roseindia&gt;
  </code></pre>
  
  <p>I dont want the tags to be encoded. I need the output in this fashion.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&lt;roseindia&gt;&lt;data&gt;sun&lt;/data&gt;&lt;abcdefg/&gt;&lt;end/&gt;&lt;/roseindia&gt;
  </code></pre>
  
  <p>Please help me on this.</p>
  
  <p>Thanks,
  Mohan</p>