title: Remove Namespace from tag
body: <p>I searched in SO but I did not found nothing that solves my problem. I hope some one can help me.</p>
  
  <p>I am building a XML file and I need to remove the Namespace <code>xmlns</code>.</p>
  
  <p>That is my code</p>
  
  <pre><code>Document xmlDocument = new Document();
  Namespace ns1 = Namespace.getNamespace("urn:iso:std:iso:20022:tech:xsd:pain.001.001.03");
  Namespace ns2 = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
  Element root = new Element("Document", ns1);
  root.addNamespaceDeclaration(ns2);
  xmlDocument.setRootElement(root);
  Element CstmrCdtTrfInitn = new Element("CstmrCdtTrfInitn");
  root.addContent(CstmrCdtTrfInitn);
  
  PrintDocumentHandler pdh = new PrintDocumentHandler();
  pdh.setXmlDocument(xmlDocument);
  request.getSession(false).setAttribute("pdh", pdh);
  
  ByteArrayOutputStream sos = new ByteArrayOutputStream();
  XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
  Format format = outputter.getFormat();
  format.setEncoding(SOPConstants.ENCODING_SCHEMA);
  outputter.setFormat(format);
  outputter.output(root, sos);
  sos.flush();
  return sos;
  </code></pre>
  
  <p>And this is the created XML-File</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"&gt;
      &lt;CstmrCdtTrfInitn xmlns=""/&gt;
  &lt;/Document&gt;
  </code></pre>
  
  <p>I have to remove the namespace <code>xmlns</code> from the tag <code>CstmrCdtTrfInitn</code>.</p>
  
  <p>Many thanks in advance.</p>