}
private Person unmarshalPerson(Reader xmlReader)
throws Exception
{
MappingObjectModelFactory factory = new MappingObjectModelFactory();
factory.mapElementToClass("person", Person.class);
factory.mapElementToField("date-of-birth", Person.class, "dateOfBirth", SimpleTypeBindings.JAVA_UTIL_DATE);
factory.mapElementToClass("phones", ArrayList.class);
factory.mapElementToClass("addresses", ArrayList.class);
factory.mapElementToClass("address", Address.class);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
unmarshaller.setEntityResolver(
new EntityResolver()
{