title: How to remove encoding="UTF-8" standalone="no" from xml Document object in Java
body: <p>I want to create XML in Java.</p>
  
  <pre><code>     DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
       DocumentBuilder docBuilder;
       docBuilder = dbfac.newDocumentBuilder();
       Document doc = docBuilder.newDocument();
  </code></pre>
  
  <p>but Java automatically creates declaration like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  </code></pre>
  
  <p>How can I remove  <code>encoding="UTF-8" standalone="no"</code> so it will be</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>Thanks!</p>