save(dataObject, rootElementURI, rootElementName, writer, xmlMarshaller);
}
public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException {
XMLMarshaller xmlMarshaller = getXmlMarshaller();
XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller();
//temporarily null out the attachment marshaller as it should not be used during serialization
xmlMarshaller.setAttachmentMarshaller(null);
OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding());
save(xmlDocument, writer, xmlMarshaller);
xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller);