int event = reader.getEventType();
if (event == XMLStreamConstants.START_ELEMENT) {
if ("policySet".equals(reader.getName().getLocalPart())) {
reader.nextTag();
StAXArtifactProcessor processor = processors.get(reader.getName());
Policy policy = (Policy)processor.read(reader);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
XMLStreamWriter writer = outputFactory.createXMLStreamWriter(outputStream);
processor.write(policy, writer);
writer.flush();