This might be a related to JAXB Marshaller - How do I suppress xmlns namespace attributes?But my problem is a little different.I do the regular java marshalling and my xsd has no namespaces.The generated xml is without namespaces as well, except for the root element.\[code\]<?xml version="1.0" encoding="UTF-8"?><rootElement xmlns:ns2="unwanted namespace">\[/code\]The \[code\]unwanted namespace\[/code\] is from another schema from the same project and I am not sure why that is being picked up at this stage.My rootElement.java generated by jaxb2-maven-plugin looks like : \[code\]@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "", propOrder = {"feed"})@XmlRootElement(name = "rootElement", namespace = "")public class RootElement{....}\[/code\]At this point all I want is to get rid of the \[code\]xmlns:ns2="unwanted namespace"\[/code\] attribute from the generated xml and I am struggling with it.I looked at my package-info.java and it looks like:\[code\]@javax.xml.bind.annotation.XmlSchema(namespace = "unwanted namespace", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)package com.mypackage;\[/code\]I tried adding he \[code\]-npa\[/code\] but it wont work on \[code\]jaxb2-maven-plugin\[/code\] for some reason. I tried the \[code\]NamespaceMapper\[/code\] but that works for changing prefixes. I could not get it to remove the namespace altogether. This is bothering me for a day now.