anchor.diff:  
   handle_recv(#state{replies = []} = S) ->
       {empty, S};
  -handle_recv(#state{replies = [Reply | Replies]} = S) ->
  -    case Reply of
  -        #xmlstreamend{} ->
  +handle_recv(#state{replies = [#xmlel{name = <<"body">>, attrs = Attrs} = Body | Replies]} = S) ->
  +    Type = detect_type(Attrs),
  +    case Type of
  +        streamend ->
               gen_server:cast(self(), stop);
           _ -> ok
       end,
  -    {Reply, S#state{replies = Replies}}.
  +    {Body, S#state{replies = Replies}}.
   
   wrap_elem(#xmlstreamstart{attrs = Attrs},
             #state{rid = Rid, sid = Sid, wait = Wait}) ->
  
positive.code: 
  handle_call(get_active, _From, #state{active = Active} = State) ->
      {reply, Active, State};
  handle_call({set_active, Active}, _From, State) ->
      {reply, ok, State#state{active = Active}};
  
  handle_call(recv, _From, State) ->
      {Reply, NS} = handle_recv(State),
  
negative.code:         _ ->
              State
      end,
      case State#state.active of
          true ->
              handle_body(Body, NewState),
              NewState;
          false ->
              store_reply(Body, NewState)
      end.
  
  handle_body(#xmlel{} = Body, #state{} = State) ->
      Stanzas = unwrap_elem(Body),
      escalus_connection:maybe_forward_to_owner(State#state.filter_pred,
                                                State, Stanzas,
                                                fun forward_to_owner/2).
  
  forward_to_owner(Stanzas, #state{owner = Owner,
                                   event_client = EventClient}) ->
  