public static void serializeByPullStream
(OMElement
element, OMOutputImpl
omOutput, boolean cache) throws XMLStreamException {
StreamingOMSerializer streamingOMSerializer = new StreamingOMSerializer();
if (cache) {
streamingOMSerializer.serialize(element.getXMLStreamReader(),
omOutput);
} else {
XMLStreamReader xmlStreamReaderWithoutCaching = element.getXMLStreamReaderWithoutCaching();
streamingOMSerializer.serialize(xmlStreamReaderWithoutCaching,
omOutput);
}
}