@NotNull final IndexedElementInvocationHandler getFixedChild(final Pair<FixedChildDescriptionImpl, Integer> info) { final FixedChildDescriptionImpl description = info.first; XmlName xmlName = description.getXmlName(); final EvaluatedXmlName evaluatedXmlName = createEvaluatedXmlName(xmlName); if (myStub != null && description.isStubbed()) { List<DomStub> stubs = myStub.getChildrenByName(xmlName.getLocalName(), xmlName.getNamespaceKey()); DomStub stub = stubs.isEmpty() ? null : stubs.get(0); DomParentStrategy strategy = stub == null ? new StubParentStrategy.Empty(myStub) : new StubParentStrategy(stub); return new IndexedElementInvocationHandler(evaluatedXmlName, description, 0, strategy, myManager, (ElementStub)stub); } final XmlTag tag = getXmlTag(); final int index = info.second; if (tag != null) { if (!tag.isValid()) { throw new PsiInvalidElementAccessException(tag); } final XmlTag[] subTags = tag.getSubTags(); for (int i = 0, subTagsLength = subTags.length; i < subTagsLength; i++) { XmlTag xmlTag = subTags[i]; if (!xmlTag.isValid()) { throw new PsiInvalidElementAccessException(xmlTag, "invalid children of valid tag: " + tag.getText() + "; subtag=" + xmlTag + "; index=" + i); } } final List<XmlTag> tags = DomImplUtil.findSubTags(subTags, evaluatedXmlName, getFile()); if (tags.size() > index) { final XmlTag child = tags.get(index); final IndexedElementInvocationHandler semElement = myManager.getSemService().getSemElement(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, child); if (semElement == null) { final IndexedElementInvocationHandler take2 = myManager.getSemService().getSemElement(DomManagerImpl.DOM_INDEXED_HANDLER_KEY, child); throw new AssertionError("No DOM at XML. Parent=" + tag + "; child=" + child + "; index=" + index+ "; second attempt=" + take2); } return semElement; } } return new IndexedElementInvocationHandler(evaluatedXmlName, description, index, new VirtualDomParentStrategy(this), myManager, null); }