Usually the XStream object have fields representing the fields in the XML. See the Person
-object in the XStream tutorial.
If you have this type of object, I think you should be able to annotate the color
property with @XStreamImplicit
to handle multiple occurences in the XML.
Somewhere along the lines of this untested code:
public class Attributes {
// 'name' and 'text' occurs only once.
public String name;
public String text;
public Size size;
// The other attributes
// color can occur multiple times.
@XStreamImplicit
public int color;
}