}
    protected void insertUpdate(ElementSpec[] data)    {      // Push the current path to the stack.      Element current = root;      int index = current.getElementIndex(offset);      while (! current.isLeaf())        {          Element child = current.getElement(index);          int editIndex = child.isLeaf() ? index : index + 1;          Edit edit = new Edit(current, editIndex);          elementStack.push(edit);          current = child;          index = current.getElementIndex(offset);        }            // Create a copy of the original path.      insertPath = new Edit[elementStack.size()];      insertPath = (Edit[]) elementStack.toArray(insertPath);      // No fracture yet.      createdFracture = false;      // Insert first content tag.      int i = 0;      recreateLeafs = false;      int type = data[0].getType();      if (type == ElementSpec.ContentType)        {          // If the first tag is content we must treat it separately to allow          // for joining properly to previous Elements and to ensure that          // no extra LeafElements are erroneously inserted.          insertFirstContentTag(data);          pos += data[0].length;          i = 1;        }      else        {        createFracture(data);          i = 0;        }            // Handle each ElementSpec individually.      for (; i < data.length; i++)        {          insertElement(data[i]);        }      // Fracture if we haven't done yet.      if (! createdFracture)        fracture(-1);      // Pop the remaining stack.      while (elementStack.size() != 0)        pop();      // Offset last index if necessary.      if (offsetLastIndex && offsetLastIndexReplace)        insertPath[insertPath.length - 1].index++;      // Make sure we havea an Edit for each path item that has a change.      for (int p = insertPath.length - 1; p >= 0; p--)            {          Edit edit = insertPath[p];          if (edit.e == fracturedParent)            edit.added.add(fracturedChild);          if ((edit.added.size() > 0 || edit.removed.size() > 0)              && ! edits.contains(edit))            edits.add(edit);        }      // Remove element that would be created by an insert at 0 with      // an initial end tag.      if (offset == 0 && fracturedParent != null          && data[0].getType() == ElementSpec.EndTagType)                {          for (int p = 0;               p < data.length && data[p].getType() == ElementSpec.EndTagType;               p++)                    {              Edit edit = insertPath[insertPath.length - p - 1];              edit.index--;              edit.removed.add(0, edit.e.getElement(edit.index));                    }                    }            }