XmlFile (ConfigurationContext context) { final XmlFile file = PsiTreeUtil.getParentOfType(context.getPsiLocation(), XmlFile.class, false); if (file != null && file.isPhysical() && XsltSupport.isXsltFile(file)) { return file; } return null; }