I have class "A" that needs to creat another class "B".
In one case, class "B" needs to have one attribute/field and in another case two attributes/fields.
I thought to split class "B" into two classes "C" and "D" that one will have one attribute ant the other one two. constructor of "A" will know which to create.
so far - so good.
now I need to serialize the whole thing.
in the output xml, "C" or "D" must have the same node name.
How can I do this?
Any other options I have?