public Object unmarshal(XMLReader xmlReader, InputSource inputSource, Class clazz) {
if(xmlUnmarshaller.getMediaType() != MediaType.APPLICATION_XML){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
SAXDocumentBuilder saxDocumentBuilder = new SAXDocumentBuilder();
xmlReader.setContentHandler(saxDocumentBuilder);
xmlReader.parse(inputSource);
return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()), clazz);
} catch(IOException e) {
throw XMLMarshalException.unmarshalException(e);
} catch(SAXException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {