// Though the byte array would work ok as well.
DOMSerializerEngine engine
= new DOMSerializerEngine( (org.w3c.dom.Node)w3cDoc.getDocumentElement() );
return saveRawXmlPart(jcrSession, baseNode, partName, mimeType, new OutputEngineInputStream(engine));
} catch (Exception e ) {
e.printStackTrace();
throw new Docx4JException("Failed to put " + partName, e);
}