class SAXSourceEntityProvider implements EntityProvider<SAXSource> {

    @Override
    public SAXSource readFrom(Class<SAXSource> type,
                              Type genericType,
                              Annotation[] annotations,
                              MediaType mediaType,
                              MultivaluedMap<String, String> httpHeaders,
                              InputStream entityStream) throws IOException {
        return new SAXSource(new InputSource(entityStream));
    }

}