void (final XmlTag element, final @NotNull Processor<? super XmlTag> tagProcessor) { final PsiLanguageInjectionHost.InjectedPsiVisitor injectedPsiVisitor = (injectedPsi, places) -> { if (injectedPsi instanceof XmlFile) { final XmlDocument injectedDocument = ((XmlFile)injectedPsi).getDocument(); if (injectedDocument != null) { final XmlTag rootTag = injectedDocument.getRootTag(); if (rootTag != null) { for (PsiElement element1 = rootTag; element1 != null; element1 = element1.getNextSibling()) { if (element1 instanceof XmlTag tag) { String tagName = tag.getLocalName(); if (element1 instanceof HtmlTag || tag.getNamespacePrefix().length() > 0) tagName = StringUtil.toLowerCase(tagName); if (LINK.equalsIgnoreCase(tagName)) { tagProcessor.process((XmlTag)element1); } } } } } } }; final XmlText[] texts = PsiTreeUtil.getChildrenOfType(element, XmlText.class); if (texts != null) { for (final XmlText text : texts) { for (PsiElement _element : text.getChildren()) { if (_element instanceof PsiLanguageInjectionHost) { InjectedLanguageManager.getInstance(_element.getProject()).enumerate(_element, injectedPsiVisitor); } } } } final XmlComment[] comments = PsiTreeUtil.getChildrenOfType(element, XmlComment.class); if (comments != null) { for (final XmlComment comment : comments) { if (comment instanceof PsiLanguageInjectionHost) { InjectedLanguageManager.getInstance(comment.getProject()).enumerate(comment, injectedPsiVisitor); } } } }