public List<Debugger.Variable> getVariables() {
    assert isValid();

    Saxon9TraceListener.MUTED = true;
    final ArrayList<Debugger.Variable> variables;
    try {
      variables = collectVariables();
    } finally {
      Saxon9TraceListener.MUTED = false;
    }

    variables.sort(VariableComparator.INSTANCE);

    return variables;
  }
public List<Debugger.Variable> getVariables()