I want to be able to alias the root list element depending upon what type of objects are contained in the list. For example, this is my current output:
<list>
<coin>Gold</coin>
<coin>Silver</coin>
<coin>Bronze</coin>
</list>
And this is what I want it to look like:
<coins>
<coin>Gold</coin>
<coin>Silver</coin>
<coin>Bronze</coin>
</coins>
I can do this at a global level by saying all lists should be aliased to coins, but I have a lot of different lists and this won't work. Any ideas on how to do this? Seems like it should be simple, but of course, it isn't.
EDIT: I should specify, I am trying to serialize objects to xml. I am using Spring 3 MVC as my web framework.