Object policyObject = policyElements.get(Integer.parseInt(idParam));
if (policyObject != null) {
response.addHeader(HTTP.CONTENT_TYPE, "text/xml");
if (policyObject instanceof Policy) {
Policy policy = (Policy) policyObject;
serializer.serialize(policy, outputStream);
} else if (policyObject instanceof PolicyReference) {
String key = ((PolicyReference) policyObject).getURI();
if (key.startsWith("#")) {
key = key.substring(key.indexOf("#") + 1);
}