void () { final DomInvocationHandler parent = getParentHandler(); assert parent != null : "write operations should be performed on the DOM having a parent, your DOM may be not very fresh"; final XmlTag parentTag = parent.getXmlTag(); if (parentTag == null) return; final EvaluatedXmlName xmlElementName = getXmlName(); final FixedChildDescriptionImpl description = getChildDescription(); final int totalCount = description.getCount(); final List<XmlTag> subTags = DomImplUtil.findSubTags(parentTag, xmlElementName, getFile()); if (subTags.size() <= myIndex) { return; } XmlTag tag = getXmlTag(); if (tag == null) return; final boolean changing = getManager().setChanging(true); try { detach(); if (totalCount == myIndex + 1 && subTags.size() >= myIndex + 1) { for (int i = myIndex; i < subTags.size(); i++) { subTags.get(i).delete(); } } else if (subTags.size() == myIndex + 1) { tag.delete(); } else { setXmlElement((XmlTag) tag.replace(parent.createChildTag(getXmlName()))); } } catch (IncorrectOperationException e) { LOG.error(e); } finally { getManager().setChanging(changing); } fireUndefinedEvent(); }