XmlTag () { 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 FixedChildDescriptionImpl description = getChildDescription(); final XmlFile xmlFile = getFile(); parent.createFixedChildrenTags(getXmlName(), description, myIndex); final List<XmlTag> tags = DomImplUtil.findSubTags(parent.getXmlTag(), getXmlName(), xmlFile); if (tags.size() > myIndex) { return tags.get(myIndex); } final XmlTag[] newTag = new XmlTag[1]; getManager().runChange(() -> { try { final XmlTag parentTag = parent.getXmlTag(); newTag[0] = (XmlTag)parentTag.add(parent.createChildTag(getXmlName())); } catch (IncorrectOperationException e) { LOG.error(e); } }); return newTag[0]; }