}
}
public void serializeAndConsume(Writer writer2, OMOutputFormat format)
throws XMLStreamException {
MTOMXMLStreamWriter writer =
new MTOMXMLStreamWriter(StAXUtils.createXMLStreamWriter(writer2));
writer.setOutputFormat(format);
internalSerializeAndConsume(writer);
writer.flush();
if (format.isAutoCloseWriter()) {
writer.close();
}
}