title: <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> is inserted when modify xml with java
body: <p>I want to modify a html(XML) to add one node. But after that, one element is added as well. And that line will make the file corrupted. So weird. Can any one have a look? </p>
  
  <p>Here is the code.</p>
  
  <pre><code>private void linkPrepare(String buildNum) {
      // TODO Auto-generated method stub
      DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
      DocumentBuilder dombuilder;
      try {
          dombuilder = domfac.newDocumentBuilder();
          InputStream is = new FileInputStream(
                  "File/test");
          Document doc = dombuilder.parse(is);
  
          NodeList nodes = doc.getElementsByTagName("div");
          Node firstNode = nodes.item(0);
          Element newNode = doc.createElement("ul");
  
          firstNode.appendChild(newNode);
  
          TransformerFactory transformerFactory = TransformerFactory
                  .newInstance();
          Transformer transformer = transformerFactory.newTransformer();
          DOMSource source = new DOMSource(doc);
          StreamResult result = new StreamResult(new File(
                  "File/test"));
          transformer.transform(source, result);
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>And here is the html file,</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;OTA&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
  &lt;ul&gt;&lt;/ul&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>