title: Remove extra annotation ns2 using NamespacePrefixMapper
body: <p>I want to remove extra annotation ns2 in the xml generated by marshal using NamespacePrefixMapper class instead of using package-info.java file.</p>
  
  <p>My code is as below:</p>
  
  <p>Req class:</p>
  
  <pre><code>package com.example;
  import javax.xml.bind.annotation.*;
  
  @XmlType(propOrder = { "password", "title", "firstName", "lastName", "email"})
  
  @XmlRootElement
  
  public class Req {
  
    private String password;
    private String title;
    private String firstName;
    private String lastName;
    private String email;
  
    @XmlElement(name= "Password")
  public String getPassword() {
      return password;
  }
   public void setPassword(String password) {
      this.password = password;
  }
  
  @XmlElement(name= "Title")
  public String getTitle() {
      return title;
  }
  public void setTitle(String title) {
      this.title = title;
  }
  @XmlElement(name= "FirstName")
  public String getFirstName() {
      return firstName;
  }
  public void setFirstName(String firstName) {
      this.firstName = firstName;
  }
  @XmlElement(name= "LastName")
  public String getLastName() {
      return lastName;
  }
  public void setLastName(String lastName) {
      this.lastName = lastName;
  }
  
  @XmlElement(name= "Email")
  public String getEmail() {
      return email;
  }
  public void setEmail(String email) {
      this.email = email;
  }
  
  }  
  </code></pre>
  
  <p>PreferredMapper class:</p>
  
  <pre><code>package com.example;
  
  import javax.xml.namespace.NamespaceContext;
  import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
  
  public class PreferredMapper extends NamespacePrefixMapper{
  
      private static final String URI ="http://schema.bsi.ib.example/service/request/v1";
  
      @Override
          public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
  
          if(URI.equals(namespaceUri)) {
              return "";
          } 
  
          return suggestion;
      }
          @Override
          public String[] getPreDeclaredNamespaceUris() {
              return new String[] { URI };
          }
  
  }
  </code></pre>
  
  <p>Test class:</p>
  
  <pre><code>package com.example;
  
  import javax.xml.bind.JAXBContext;
  import javax.xml.bind.JAXBElement;
  import javax.xml.bind.JAXBException;
  import javax.xml.bind.Marshaller;
  import javax.xml.namespace.QName;
  import com.example.Req;
  import com.example.PreferredMapper;
  import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
  
  
  public class Test {
      public static void main(String args[]) throws JAXBException
      {
  
          setRequest("Tiger123", "Miss","Rose","Crocker","hello@world.com");
  
      }
  
      public static void setRequest(String passWord, String title, String firstName, String lastName,String email) throws JAXBException
      {
          JAXBContext context = JAXBContext.newInstance(Req.class);
  
          Req ibw=new Req();
  
          ibw.setEmail(email);
          ibw.setPassword(passWord);
          ibw.setTitle(title);
          ibw.setFirstName(firstName);
          ibw.setLastName(lastName);
  
          JAXBElement&lt;Req&gt; element=new JAXBElement&lt;Req&gt; (new QName("http://schema.bsi.ib.example/service/request/v1","CustomerProfile"),Req.class,ibw);
          Marshaller m=context.createMarshaller();
          m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
          m.setProperty("com.sun.xml.bind.namespacePrefixMapper", new PreferredMapper());
  
          m.marshal(element, System.out);
  
      }   
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;ns2:CustomerProfile xmlns:ns2="http://schema.bsi.ib.example/service/request/v1"&gt;
      &lt;Password&gt;Tiger123&lt;/Password&gt;
      &lt;Title&gt;Miss&lt;/Title&gt;
      &lt;FirstName&gt;Rose&lt;/FirstName&gt;
      &lt;LastName&gt;Crocker&lt;/LastName&gt;
      &lt;Email&gt;hello@world.com&lt;/Email&gt;
  &lt;/ns2:CustomerProfile&gt;
  </code></pre>
  
  <p>not able to remove ns2 with above code please help</p>