}
try {
Class classToUnmarshalTo = getClassToUnmarshalTo(javaClass);
XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller);
staxReader.setErrorHandler(xmlUnmarshaller.getErrorHandler());
XMLStreamReaderInputSource inputSource = new XMLStreamReaderInputSource(streamReader);
JAXBElement unmarshalled = buildJAXBElementFromObject(xmlUnmarshaller.unmarshal(staxReader, inputSource, classToUnmarshalTo), javaClass);
if(classToUnmarshalTo != javaClass){
JAXBElement returnVal = new JAXBElement(unmarshalled.getName(), javaClass, unmarshalled.getScope(), unmarshalled.getValue());
return returnVal;