anchor.diff:  %%% BOSH XML elements
   %%%===================================================================
   
  +-spec session_creation_body(Rid :: integer(), To :: binary()) -> exml:element().
   session_creation_body(Rid, To) ->
       session_creation_body(?DEFAULT_WAIT, <<"1.0">>, <<"en">>, Rid, To, nil).
   
  +-spec session_creation_body(Wait :: integer(), Version :: binary(), Lang :: binary(),
  +                            Rid :: integer(), To :: binary(), Sid :: binary() | nil) ->
  +    exml:element().
   session_creation_body(Wait, Version, Lang, Rid, To, nil) ->
       empty_body(Rid, nil,
                  [{<<"content">>, <<"text/xml; charset=utf-8">>},
  
positive.code: recv(#client{rcv_pid = Pid}) ->
      gen_server:call(Pid, recv).
  
  get_requests(#client{rcv_pid = Pid}) ->
      gen_server:call(Pid, get_requests).
  
  %% This flag makes client to fail on stream error,
  %% even if it arrives out of order (according to RIDs)
  set_quickfail(#client{rcv_pid = Pid}, QuickfailFlag) ->
      gen_server:call(Pid, {set_quickfail, QuickfailFlag}).
  
  
negative.code:     Transport = gen_server:call(Pid, get_transport),
      {ok, Transport}.
  
  -spec send(escalus:client(), exml:element()) -> ok.
  send(#client{rcv_pid = Pid} = Socket, Elem) ->
      gen_server:call(Pid, {send, Socket, Elem}).
  
  -spec is_connected(escalus:client()) -> boolean().
  is_connected(#client{rcv_pid = Pid}) ->
      erlang:is_process_alive(Pid).
  
  -spec reset_parser(escalus:client()) -> ok.
  reset_parser(#client{rcv_pid = Pid}) ->
      gen_server:cast(Pid, reset_parser).
  
  -spec stop(escalus:client()) -> ok | already_stopped.
  stop(#client{rcv_pid = Pid}) ->
      try
          gen_server:call(Pid, stop)
  