OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
XPath xpath = contentDom.getXPath();
if (this instanceof OdfSpreadsheetDocument) {
TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]", contentDom, XPathConstants.NODE);
lastCell.appendChild(drawFrame);
drawFrame.removeAttribute("text:anchor-type");
} else if (this instanceof OdfTextDocument) {
TextPElement lastPara = (TextPElement) xpath.evaluate("//text:p[last()]", contentDom, XPathConstants.NODE);
if (lastPara == null) {
lastPara = ((OdfTextDocument) this).newParagraph();