return createJAXBElementIfRequired(value);
}
public JAXBElement unmarshal(XMLEventReader eventReader, Class javaClass) throws JAXBException {
Class classToUnmarshalTo = getClassToUnmarshalTo(javaClass);
XMLEventReaderReader staxReader = new XMLEventReaderReader();
staxReader.setErrorHandler(xmlUnmarshaller.getErrorHandler());
XMLEventReaderInputSource inputSource = new XMLEventReaderInputSource(eventReader);
JAXBElement unmarshalled = buildJAXBElementFromObject(xmlUnmarshaller.unmarshal(staxReader, inputSource, classToUnmarshalTo), javaClass);
if(classToUnmarshalTo != javaClass){
JAXBElement returnVal = new JAXBElement(unmarshalled.getName(), javaClass, unmarshalled.getScope(), unmarshalled.getValue());