anchor.diff:      Transport = gen_server:call(Pid, get_transport),
       {ok, Transport}.
   
  -send(#client{socket = Socket, ssl = true}, Elem) ->
  -    ssl:send(Socket, exml:to_iolist(Elem));
  -send(#client{rcv_pid=Pid, compress = {zlib, {_,Zout}}}, Elem) ->
  -    gen_server:cast(Pid, {send_compressed, Zout, Elem});
  -send(#client{socket = Socket}, Elem) ->
  -    gen_tcp:send(Socket, exml:to_iolist(Elem)).
  +send(#client{rcv_pid = Pid} = Client, Elem) ->
  +    gen_server:cast(Pid, {send, Client, Elem}).
   
   is_connected(#client{rcv_pid = Pid}) ->
       erlang:is_process_alive(Pid).
  
positive.code:         {false, false} ->
              gen_tcp:send(Socket, exml:to_iolist(StreamEnd))
      end.
  
negative.code:     wait_until_closed(S#state.socket),
      {stop, normal, ok, S}.
  
  handle_cast({send, #client{socket = Socket, ssl = Ssl, compress = Compress},
               Elem}, #state{on_request = OnRequestFun} = State) ->
      Reply = case {Ssl, Compress} of
                  {true, _} ->
                      ssl:send(Socket, exml:to_iolist(Elem));
                  {false, {zlib, {_,Zout}}} ->
                      Deflated = zlib:deflate(Zout, exml:to_iolist(Elem), sync),
                      gen_tcp:send(State#state.socket, Deflated);
                  {false, false} ->
                      gen_tcp:send(Socket, exml:to_iolist(Elem))
              end,
      OnRequestFun(Reply),
      {noreply, State};
  handle_cast(reset_parser, #state{parser = Parser} = State) ->
      {ok, NewParser} = exml_stream:reset_parser(Parser),
  