internalSerialize(writer, true, includeXMLDeclaration);
}
protected void internalSerialize(XMLStreamWriter writer2, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
if (includeXMLDeclaration) {
//Check whether the OMOutput char encoding and OMDocument char
//encoding matches, if not use char encoding of OMOutput
String outputCharEncoding = writer.getCharSetEncoding();
if (outputCharEncoding == null || "".equals(outputCharEncoding)) {
writer.getXmlStreamWriter().writeStartDocument(charSetEncoding,
xmlVersion);
} else {
writer.getXmlStreamWriter().writeStartDocument(outputCharEncoding,
xmlVersion);
}
}
Iterator children = this.getChildren();