boolean (PsiElement tag, XmlAttributeValue value, LocalSearchScope scope) { final Query<PsiReference> query = ReferencesSearch.search(tag, scope, true); for (PsiReference reference : query) { final PsiElement e = reference.getElement(); if (e != value) { final XmlTag t = PsiTreeUtil.getParentOfType(e, XmlTag.class); if (t != null && !PsiTreeUtil.isAncestor(tag, t, true)) { return true; } } } return false; }