anchor.diff:                  {<<"wait">>, list_to_binary(integer_to_list(Wait))},
                   {<<"xml:lang">>, Lang},
                   {<<"to">>, To}]);
  -
   session_creation_body(_Wait, _Version, Lang, Rid, To, Sid) ->
       empty_body(Rid, Sid,
                   [{<<"xmlns:xmpp">>, ?NS_BOSH},
  
positive.code:     NewState = wrap_and_send(transport(State), exml:to_iolist(StreamEnd), Ref, State),
      {noreply, NewState#state{ waiting_requesters = [{Ref, From} | WaitingRequesters] }}.
  
  handle_cast(stop, State) ->
      {stop, normal, State};
  handle_cast({send_raw, Transport, Body}, State) ->
      NewState = send(Transport, Body, State),
      {noreply, NewState};
  handle_cast({resend_raw, Transport, Body}, State) ->
      NewState = send(Transport, Body, make_ref(), State#state.rid, State),
      {noreply, NewState};
  handle_cast({pause, Transport, Seconds},
              #state{rid = Rid, sid = Sid} = State) ->
      NewState = send(Transport, pause_body(Rid, Sid, Seconds), State),
      {noreply, NewState};
  handle_cast(reset_parser, #state{parser = Parser} = State) ->
      {ok, NewParser} = exml_stream:reset_parser(Parser),
      {noreply, State#state{parser = NewParser}}.
  
  
  %% Handle async HTTP request replies.
  handle_info(_, #state{ terminated = true } = S) ->
      {noreply, S};
  handle_info({http_reply, Ref, Body, Transport} = HttpReply,
  
negative.code: %%% 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">>},
  