private void addVariable(ElemVariable variable, boolean global, Collection<Debugger.Variable> variables) {
    final Debugger.Variable.Kind kind = variable instanceof ElemParam ?
                                        Debugger.Variable.Kind.PARAMETER : Debugger.Variable.Kind.VARIABLE;

    assert global == variable.getIsTopLevel() : global + " vs. " + variable.getIsTopLevel() + " (" + variable.getName() + ")";

    final String name = variable.getName().getLocalName();
    try {
      final Value value = kind == Debugger.Variable.Kind.PARAMETER ?
                          eval("$" + variable.getName().toString()) : // http://youtrack.jetbrains.net/issue/IDEA-78638
                          new XObjectValue(variable.getValue(myTransformer, myCurrentNode));

      variables.add(new VariableImpl(name, value, global, kind, variable.getSystemId(), variable.getLineNumber()));
    } catch (TransformerException | Debugger.EvaluationException e) {
      debug(e);
    }
  }
private void addVariable(ElemVariable variable, boolean global, Collection<Debugger.Variable> variables)