}
boolean isCollection = InjectionUtils.isSupportedCollectionOrArray(type);
Class<?> theGenericType = isCollection ? InjectionUtils.getActualType(genericType) : type;
Class<?> theType = getActualType(theGenericType, genericType, anns);
Unmarshaller unmarshaller = createUnmarshaller(theType, genericType, isCollection);
XMLStreamReader xsr = createReader(type, realStream, isCollection);
Object response = null;
if (JAXBElement.class.isAssignableFrom(type)
|| !isCollection && (unmarshalAsJaxbElement
|| jaxbElementClassMap != null && jaxbElementClassMap.containsKey(theType.getName()))) {
response = unmarshaller.unmarshal(xsr, theType);
} else {
response = unmarshaller.unmarshal(xsr);
}
if (response instanceof JAXBElement && !JAXBElement.class.isAssignableFrom(type)) {
response = ((JAXBElement<?>)response).getValue();
}
if (isCollection) {