@Nullable
    public static XmlTag getTemplateTag(@NotNull PsiElement location, boolean isExpression, boolean requireName) {
        PsiElement p = isExpression ? location.getContainingFile().getContext() : location;
        while ((p = PsiTreeUtil.getParentOfType(p, XmlTag.class)) != null) {
            final XmlTag _p = ((XmlTag)p);
            if (XsltSupport.isTemplate(_p, requireName)) return _p;
        }
        return null;
    }
@Nullable
    public static XmlTag getTemplateTag(@NotNull PsiElement location, boolean isExpression, boolean requireName)