event = eventReader.nextEvent();
assertTrue("Not a end element", event.isEndElement());
assertEquals("Invalid end event local name", REQUEST_ELEMENT,
event.asEndElement().getName().getLocalPart());
assertEquals("Invalid end event namespace", NAMESPACE_URI,
event.asEndElement().getName().getNamespaceURI());
Namespace namespace = eventFactory.createNamespace(NAMESPACE_URI);
QName name = new QName(NAMESPACE_URI, RESPONSE_ELEMENT);
eventWriter
.add(eventFactory.createStartElement(name, null, Collections.singleton(namespace).iterator()));
eventWriter.add(eventFactory.createEndElement(name, Collections.singleton(namespace).iterator()));