XMLStreamWriter writer = xof.createXMLStreamWriter(baos);
AssertionSet set = AssertionSet.createAssertionSet(Arrays.asList(new PolicyAssertion[] {token}));
Policy policy = Policy.createPolicy(Arrays.asList(new AssertionSet[] { set }));
PolicySourceModel sourceModel = ModelGenerator.getGenerator().translate(policy);
PolicyModelMarshaller pm = PolicyModelMarshaller.getXmlMarshaller(true);
pm.marshal(sourceModel, writer);
writer.close();
return baos.toByteArray();
}catch (Exception e){
throw new WebServiceException(e);