PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new XmlElementVisitor() { @Override public void visitXmlElement(final @NotNull XmlElement element) { if (element instanceof XmlElementContentSpec || element instanceof XmlEntityRef ) { doCheckRefs(element, holder); } } }; }