Is it possible to have same @XmlElement with name that is not constant name? For example I want this:
MyObject myObj = new MyObject("myName");
@XmlElement(name=myObj.getName())
public String elementItem;
This code is not correct, but can I do something like that in some way?
**P.S I must doing this because I have one Rest web service with attribute "name". User can send a different name through this rest ws and I must to create XML with element which name is that inserted name.
Some XML would look like:
<a>
<b>
<c>
<a>
And some would look like:
<x>
<y>
<z>
<x>
This a,b,c or x,y,z are given in input parameter of REST WS.