実際、XStream サイト (Converter チュートリアル) に回答があります ;)
http://x-stream.github.io/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;
}
(ページの最後の例/コード ブロックにあります。)
HTH
編集:そのコードブロックを探すだけでなく、そのチュートリアル全体を実行したいことを追加したかっただけです。独自のコンバーターを作成し、それを XStream インスタンスに登録する必要があります。(当たり前のことかもしれませんが、念のため…)