title: Xml transformation encoding problem
body: <p>Hi I have a simple code:  </p>
  
  <pre><code>    InputSource is = new InputSource(new StringReader(xml))
      Document d = documentBuilder.parse(is)
      StringWriter result = new StringWriter()
      DOMSource ds = new DOMSource(d)
      Transformer t = TransformerFactory.newInstance().newTransformer()
      t.setOutputProperty(OutputKeys.INDENT, "yes");
      t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
      t.setOutputProperty(OutputKeys.STANDALONE, "yes");
      t.setOutputProperty(OutputKeys.ENCODING,"UTF-16")
      t.transform(ds,new StreamResult(result))
      return result.toString()
  </code></pre>
  
  <p>that should trasnform an xml to UTF-16 encoding. Although internal representation of String in jvm already uses UTF-16 chars as far I know, but my expectations are that the result String should contain a header where the encoding is set to "UTF-16", originla xml where it was UTF-8 but I get:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  </code></pre>
  
  <p>(also the standalone property seems to be wrong)
  The transformer instance is: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl
  (what I think is a default)
  So what I miss here?</p>