title: Omitting the standalone attribute in xml declaration when using Java DOM + Transformer.
body: <p>Is there any way to tell the Transformer (when serializing an XML document using DOM), to omit the standalone attribute?</p>
  
  <p>Preferably without using a hack, i.e. ommitting the whole XML declaration and then prepending it manually.</p>
  
  <p>My current code:</p>
  
  <pre><code>Transformer transformer = TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperty(OutputKeys.INDENT, "yes");
  transformer.setOutputProperty(OutputKeys.STANDALONE, "yes"); //Note nothing is changed
  
  StreamResult result = new StreamResult(new StringWriter());
  DOMSource source = new DOMSource(document);
  transformer.transform(source, result);
   return result.getWriter().toString();
  </code></pre>
  
  <p>Current:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;someElement/&gt;
  </code></pre>
  
  <p>Intended:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"&gt;
  &lt;someElement/&gt;
  </code></pre>