serializeAndConsume(omOutput);
omOutput.flush();
}
public void serializeAndConsume(Writer writer, OMOutputFormat format) throws XMLStreamException {
OMOutputImpl omOutput = new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer));
omOutput.setOutputFormat(format);
serializeAndConsume(omOutput);
omOutput.flush();
}