boolean (final @NotNull XmlTag rootTag, final String[] tagNames, final PsiElementProcessor<? super XmlTag> processor, Set<? super XmlTag> visitedTags) { if (visitedTags == null) visitedTags = new HashSet<>(3); else if (visitedTags.contains(rootTag)) return true; visitedTags.add(rootTag); XmlTag[] tags = rootTag.getSubTags(); NextTag: for (XmlTag tag : tags) { for(String tagName:tagNames) { if (equalsToSchemaName(tag, tagName)) { final String name = tag.getAttributeValue("name"); if (name != null) { if (!processor.execute(tag)) { return false; } } continue NextTag; } } if (equalsToSchemaName(tag, INCLUDE_TAG_NAME)) { final String schemaLocation = tag.getAttributeValue("schemaLocation"); if (schemaLocation != null) { final XmlFile xmlFile = XmlUtil.findNamespace(rootTag.getContainingFile(), schemaLocation); if (xmlFile != null) { final XmlDocument includedDocument = xmlFile.getDocument(); if (includedDocument != null) { if (!processTagsInNamespaceInner(includedDocument.getRootTag(), tagNames, processor, visitedTags)) return false; } } } } } return true; }