@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
    return new XmlElementVisitor() {
      @Override
      public void visitXmlAttributeValue(@NotNull XmlAttributeValue value) {
        checkRefs(value, holder, 0);
      }

      @Override
      public void visitXmlAttribute(@NotNull XmlAttribute attribute) {
        int startIndex = !attribute.getNamespacePrefix().isEmpty() ? 2 : 1;
        checkRefs(attribute, holder, startIndex);
      }

      @Override
      public void visitXmlDoctype(@NotNull XmlDoctype xmlDoctype) {
        checkRefs(xmlDoctype, holder, 0);
      }

      @Override
      public void visitXmlTag(@NotNull XmlTag tag) {
        checkRefs(tag, holder, 0);
      }

      @Override
      public void visitXmlProcessingInstruction(@NotNull XmlProcessingInstruction processingInstruction) {
        checkRefs(processingInstruction, holder, 0);
      }
    };
  }
@NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly)