I have a class with a XmlElementWrapper annotation like:
...
@XmlElementWrapper(name="myList")
@XmlElements({
@XmlElement(name="myElement") }
)
private List<SomeType> someList = new LinkedList();
... This code produces XML like
<myList>
<myElement> </myElement>
<myElement> </myElement>
<myElement> </myElement>
</myList>
so far so good.
But now I need to add attributes to the list tag to get XML like
<myList number="2">
<myElement> </myElement>
<myElement> </myElement>
<myElement> </myElement>
</myList>
Is there a 'smart way to achieve this without creating a new class that contains represents the list?