public void replaceWith(String newText) throws InvalidNavigationException {
if (validate() == false) {
throw new InvalidNavigationException("No matched string at this position");
}
OdfElement parentElement = getContainerElement();
int leftLength = getText().length();
int index = mIndexInContainer;
delete(index, leftLength, parentElement);
OdfTextSpan textSpan = new OdfTextSpan((OdfFileDom) parentElement.getOwnerDocument());
textSpan.addContentWhitespace(newText);
/*if (startElement instanceof OdfStyleBase)
textSpan.setProperties(((OdfStyleBase) startElement)
.getStyleProperties());*/
mIsInserted = false;