I have a fairly large repetitive XML to create using JAXB. Storing the whole object in the memory then do the marshaling takes too much memory. Essentially, my XML looks lik
For me, simply calling xmlStreamWriter.setDefaultNamespace("")
solved the issue.
One more thing you have to care in order to remove the namespace prefix from the output is that everywhere you have @XmlElement ensure it does not include the namespace property like @XmlElement(name="", namespace"http://...")
; otherwise, none of solutions will work.