title: Java XML: how to output the namespace of child elements?
body: <p>I'm using Java's <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/Transformer.html" rel="nofollow noreferrer">Transformer</a> class to process an XML Document object.</p>
  
  <p>This is the code that creates the Transformer:</p>
  
  <pre><code>import javax.xml.transform.TransformerFactory;
  import javax.xml.transform.OutputKeys;
  import javax.xml.transform.Transformer;
  
  Transformer transformer = TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperty(OutputKeys.INDENT, "no");
  transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
  
  transformer.transform(source, result);
  </code></pre>
  
  <p>Currently, my output looks like this: &lt;svg ... /&gt;. I'd like it to include the namespace of each element, as in &lt;svg:svg ... /&gt;</p>
  
  <p>How can I do that ?</p>