Im using jaxb to generate XML Request. Below are all the code details. I have also tried the package-info thing, but it didn\'t worked for me. Like i want to add the namespace o
I would like to refer you to the following answer by @MichaelKay:
https://stackoverflow.com/a/50300327/303810
It is not the same question, but it is the same answer:
In XML applications the principle should be:
(a) Receiving applications shouldn't care about the insignificant lexical detail of how the XML is written. (The best way of achieving this is to use a respectable XML parser to read the XML.)
(b) Writing applications should be free to use whatever lexical conventions they find convenient. (Which means you can use any respectable serialization library to write the XML.)
Basically, you should not care. If you do, there's something seriously wrong with the way you process XML. It must not matter how namespaces are declared. Why should it?
To answer your question, this is not possible with standard JAXB.