Text newText = getOwnerDocument().createTextNode(
substringData(offset, getLength() - offset));
deleteData(0, offset);
Node refNode = getNextSibling();
if (refNode == null) {
getParentNode().appendChild(newText);
} else {
getParentNode().insertBefore(newText, refNode);
}
return this;