'XML Namespace in field line java

I want to my response SOAP be like:

<code>
<NS2:code1 xmlns:NS2="namespace">0000</NS2:code1>
<NS3:code2 xmlns:NS3="namespace">0001</NS3:code2>
</code>

How can I manipulate this in java/camel cxf? I've tried to add

@XmlElement(namespace = "namespace")

but the body stayed like this

<ns2:response xmlns:ns2="responseNamespace" xmlns:ns5="namespace" >
<code>
<ns5:code>0000</ns5:code>
<ns5:code1>0001</ns5:code1>
</code>

How can I declare namespace in the same line like the first example?

My java data class:

@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "code", propOrder = { "code1", "code2" })
public class Code {
    @XmlElement(namespace = "namespace")
    protected String code1;
    @XmlElement(namespace = "namespace")
    protected String code2;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source