@Override
    @Nullable
    public XsltTemplate getTemplate() {
        final PsiReference[] references = getReferences();
        for (PsiReference reference : references) {
            final PsiElement t = reference.resolve();
            if (t instanceof XsltTemplate) {
                return (XsltTemplate)t;
            }
        }
        return null;
    }
@Override
    @Nullable
    public XsltTemplate getTemplate()