private static @Nullable DomInvocationHandler createIndexedHandler(DomInvocationHandler parent,
                                                                     String localName,
                                                                     String namespace,
                                                                     DomFixedChildDescription description, XmlTag tag) {
    final int totalCount = description.getCount();

    int index = 0;
    PsiElement current = tag;
    while (true) {
      current = current.getPrevSibling();
      if (current == null) {
        break;
      }
      if (current instanceof XmlTag xmlTag) {
        if (localName.equals(xmlTag.getLocalName()) && namespace.equals(xmlTag.getNamespace())) {
          index++;
          if (index >= totalCount) {
            return null;
          }
        }
      }
    }

    final DomManagerImpl myDomManager = parent.getManager();
    return new IndexedElementInvocationHandler(parent.createEvaluatedXmlName(description.getXmlName()), (FixedChildDescriptionImpl)description, index,
                                               new PhysicalDomParentStrategy(tag, myDomManager), myDomManager, null);
  }
private static @Nullable DomInvocationHandler createIndexedHandler(DomInvocationHandler parent,
                                                                     String localName,
                                                                     String namespace,
                                                                     DomFixedChildDescription description, XmlTag tag)