delete(eIndex, TextExtractor.getText(copyParentNode).length() - eIndex, copyParentNode);
delete(0, sIndex, copyParentNode);
optimize(copyParentNode);
Node childNode = copyParentNode.getFirstChild();
while (childNode != null) {
textSpan.appendChild(childNode.cloneNode(true));
childNode = childNode.getNextSibling();
}
// apply text style for the textSpan
if (copyParentNode instanceof OdfStylableElement) {
applyTextStyleProperties(getTextStylePropertiesDeep((OdfStylableElement) copyParentNode), textSpan);