boolean (PsiElement element, boolean deepFlag, boolean wideFlag, boolean processIncludes) { if (deepFlag) if (!processor.execute(element)) return false; PsiElement startFrom = element.getFirstChild(); if (element instanceof XmlEntityRef ref) { if (!visitedEntities.add(ref.getText())) return true; PsiElement newElement = parseEntityRef(targetFile, ref); while (newElement != null) { if (!processElement(newElement, deepFlag, wideFlag, processIncludes)) return false; newElement = newElement.getNextSibling(); } return true; } else if (element instanceof XmlConditionalSection xmlConditionalSection) { if (!xmlConditionalSection.isIncluded(targetFile)) return true; startFrom = xmlConditionalSection.getBodyStart(); } else if (processIncludes && XmlIncludeHandler.isXInclude(element)) { if (IdempotenceChecker.isLoggingEnabled()) { IdempotenceChecker.logTrace("Processing xinclude " + element.getText()); } PsiElement[] tags = InclusionProvider.getIncludedTags((XmlTag)element); for (PsiElement psiElement : tags) { if (IdempotenceChecker.isLoggingEnabled()) { IdempotenceChecker.logTrace("Processing included tag " + psiElement); } if (!processElement(psiElement, deepFlag, wideFlag, true)) return false; } } for (PsiElement child = startFrom; child != null; child = child.getNextSibling()) { if (!processElement(child, deepFlag, wideFlag, processIncludes) && !wideFlag) return false; } return true; }