Resource resource = registry.get(regPath);
subscriptionOrig.setExpires(subscription.getExpires());
// set the new content
OMElement subElem = subscriptionToRegStorage(subscriptionOrig, resource, false);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
subElem.serialize(outStream);
resource.setContent(outStream.toByteArray());
resource.setMediaType(EPR_TYPE);
registry.put(regPath, resource);
} catch (RegistryException e) {
log.error("Unable to update the registry", e);