How to create an xml with multile root nodes
<p>Example-</p>

<pre><code>&lt;Envision&gt;
      &lt;Employee&gt;
         &lt;Employee-code&gt;Shiva kumar&lt;/Employee-code&gt;
         &lt;Employee-Name&gt;474&lt;/Employee-Name&gt;
      &lt;/Employee&gt;
  &lt;Employee&gt;
         &lt;Employee-code&gt;Santhosh Kumar&lt;/Employee-code&gt;
         &lt;Employee-Name&gt;475&lt;/Employee-Name&gt;
      &lt;/Employee&gt;
&lt;/Envision&gt;
</code></pre>

<p>I want to create an xml file as shown above xml.But i am able to do only this -
</p>

<pre><code>&lt;Employee&gt;
&lt;Employee-code&gt;Shiva kumar&lt;/Employee-code&gt;
&lt;Employee-name&gt;474&lt;/Employee-name&gt;
&lt;Employee&gt;

&lt;/Envision&gt;
</code></pre>

<p>by following code-</p>

<p>DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();</p>

<pre><code>  DocumentBuilder builder=factory.newDocumentBuilder();

  Document doc=builder.newDocument();

  Element root=doc.createElement("Envision");

  doc.appendChild(root);

  Element ele=doc.createElement("Employee_Name");
  ele.appendChild(doc.createTextNode("Shiva Kumar"));
  root.appendChild(ele);

  ele=doc.createElement("Employee_Code");
  ele.appendChild(doc.createTextNode("474"));
  root.appendChild(ele);

  TransformerFactory transformerFactory =TransformerFactory.newInstance();
  Transformer transformer = transformerFactory.newTransformer();
  DOMSource source = new DOMSource(doc);
  StreamResult result =  new StreamResult(System.out);
  transformer.transform(source, result);
</code></pre>

<p>Whenever i want to add second block to that code by appending this below code to above code
after the employee code tag </p>

<pre><code>  Element root1=doc.createElement("Envision");

  doc.appendChild(root1);


      ele=doc.createElement("Employee_Name");
  ele.appendChild(doc.createTextNode("Vijay Babu"));
  root1.appendChild(ele);

  ele=doc.createElement("Employee_Code");
  ele.appendChild(doc.createTextNode(""));
  root1.appendChild(ele);
</code></pre>

<p>Then i am gettting an Error message like "Creation of the node is not permitted".Please help me in this case</p>
