public static List<XPathVariableReference> collectVariableReferences(PsiElement block) {
        final VariableReferenceCollector visitor = new VariableReferenceCollector();
        block.accept(visitor);

        final List<XPathVariableReference> list = new ArrayList<>(visitor.getMatches());
        list.sort(XsltCodeInsightUtil.POSITION_COMPARATOR);
        return list;
    }
public static List<XPathVariableReference> collectVariableReferences(PsiElement block)