@Override
    protected @NotNull CachedValue<Map<String, DomElement>> create(final @NotNull DomElement scope) {
      final DomManager domManager = scope.getManager();
      //noinspection ConstantConditions
      if (domManager == null) throw new AssertionError("Null DomManager for " + scope.getClass());
      final Project project = domManager.getProject();
      return CachedValuesManager.getManager(project).createCachedValue(new CachedValueProvider<>() {
        @Override
        public Result<Map<String, DomElement>> compute() {
          final Map<String, DomElement> map = new HashMap<>();
          visitDomElement(scope, map);
          return new Result<>(map, PsiModificationTracker.MODIFICATION_COUNT);
        }

        private void visitDomElement(DomElement element, final Map<String, DomElement> map) {
          if (myClass.isInstance(element)) {
            final String name = ElementPresentationManager.getElementName(element);
            if (name != null && !map.containsKey(name)) {
              map.put(name, element);
            }
          }
          else {
            for (final DomElement child : DomUtil.getDefinedChildren(element, true, myAttribute)) {
              visitDomElement(child, map);
            }
          }
        }
      }, false);
    }
@Override
    protected @NotNull CachedValue<Map<String, DomElement>> create(final @NotNull DomElement scope)