final Context context = begin();
final JAXBElement<T> object;
try {
object = unmarshaller.unmarshal(input, declaredType);
} finally {
context.finish();
}
input.close(); // Despite its name, this method does not close the underlying input stream.
return object;
}