title: How to remove the default root element namespace prefix from XML generated using JAXB
body: <p>I am using JAXB with spring-mvc framework to generate XML. This is the example of root element: </p>
  
  <pre><code>&lt;ns2:urlset xmlns:ns2="http://www.example.com"&gt;
  </code></pre>
  
  <p>However, this is what I want (no XML namespace prefix <code>ns2</code>):</p>
  
  <pre><code>&lt;urlset xmlns="http://www.example.com"&gt;
  </code></pre>
  
  <p>I've tried to use the following <code>package-info.java</code> to remove the default prefix <code>ns2</code>.</p>
  
  <pre><code>@javax.xml.bind.annotation.XmlSchema(  
      namespace = "http://www.example.com",   
      xmlns = {@javax.xml.bind.annotation.XmlNs(namespaceURI = "http://www.example.com", prefix="")},  
      elementFormDefault = javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED)  
  package com.example.code
  </code></pre>
  
  <p>The prefix can be changed to other value (than <code>ns2</code>) if I set <code>prefix</code> to another string. But the prefix can't be removed by setting <code>prefix</code> value to "". It still shows the default one <code>ns2</code>. Is there a way to remove the default prefix <code>ns2</code>?</p>
  
  <p>Another question is that if the <code>standalone</code> attribute in the header of the XML can be removed too? If so, can it be done through <code>package-info.java</code>?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  </code></pre>