I have to production something like this:
<Doc p1="something">
<Ext code="one"/>
<Ext name="two"/>
</Doc>
I know how to do the part with my Doc class, the "code" and "name" are just properties of the Doc, so I was going to create a wrapper class Ext to produce that element, but I'm not sure how to use "code" as the attribute in one case and "name" as the attribute in another case. I could always create two different wrapper classes I suppose, but I was wondering if there was an easier way, such as some way to set what the @XmlAttribute(name=) will be with a variable somehow.