XACMLAuthzDecisionQueryType xacmlQuery = SOAPSAMLXACMLUtil.getXACMLQueryType(doc);
ResponseType samlResponseType = SOAPSAMLXACMLUtil.handleXACMLQuery(pdp, issuer, xacmlQuery);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos);
SAMLResponseWriter samlResponseWriter = new SAMLResponseWriter(xmlStreamWriter);
samlResponseWriter.write(samlResponseType);
Document responseDocument = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
return new DOMSource(responseDocument.getDocumentElement());
} catch (Exception e) {
throw logger.xacmlPDPMessageProcessingError(e);