// unmarshaller.setEventHandler(new DefaultValidationEventHandler());
JAXBElement jaxbElement = null;
if ("Invoice".equals(elementType)) {
jaxbElement = unmarshaller.unmarshal(new DOMStreamReader(e), Invoice.class);
modelObject = (Invoice) jaxbElement.getValue();
} else if ("Payment".equals(elementType)) {
jaxbElement = unmarshaller.unmarshal(new DOMStreamReader(e), Payment.class);
modelObject = (Payment) jaxbElement.getValue();
} else if ("Contact".equals(elementType)) {
jaxbElement = unmarshaller.unmarshal(new DOMStreamReader(e), Contact.class);
modelObject = (Contact) jaxbElement.getValue();
} else {
throw new RuntimeException("Unrecognised type: " + elementType);
}