Actually, there is an answer on the XStream site -- in the Converter tutorial ;)
From http://xstream.codehaus.org/converter-tutorial.html:
public Object unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context) {
Birthday birthday = new Birthday();
if (reader.getAttribute("gender").charAt(0) == 'm') {
birthday.setGenderMale();
} else {
birthday.setGenderFemale();
}
reader.moveDown();
Person person = (Person)context.convertAnother(birthday, Person.class);
birthday.setPerson(person);
reader.moveUp();
reader.moveDown();
Calendar date = (Calendar)context.convertAnother(birthday, Calendar.class);
birthday.setDate(date);
reader.moveUp();
return birthday;
}
(It's in the very last example/code block on the page.)
HTH
EDIT: Just wanted to add that you'll want to go through that whole tutorial, and not just seek out that code block. You'll need to create your own converter and register it with your XStream instance. (Probably obvious, but just in case...)