Another way is to tell the marshaller to always use a certain prefix
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapper() {
@Override
public String getPreferredPrefix(String arg0, String arg1, boolean arg2) {
return "ns1";
}
});'