data = serializeWithStax(doc, staxOutputFactory, out);
} else {
data = serializeWithXOM(doc, out);
}
} else if (mode.equals("saxon")) {
saxonSerializer.transform(saxonDoc, new StreamResult(out));
data = out.toByteArray();
} else if (mode.equals("dom")) {
domSerializer.transform(new DOMSource(domDoc), new StreamResult(out));
data = out.toByteArray();
} else if (mode.startsWith("fi")) {
if (mode.indexOf("stax") >= 0) {
// data = serializeWithStax(doc, staxOutputFactory);
data = serializeWithFastInfosetStax(doc, (XMLStreamWriter)fiSerializer, fiMethod, out);