ContextProvider (PsiElement element) { return element instanceof XPathElement ? getContextProvider(element instanceof XPathFile ? (PsiFile)element : element.getContainingFile()) : new DefaultProvider(PsiTreeUtil.getParentOfType(element, XmlElement.class, false)); }