anchor.diff:      escalus_pubsub_stanza:iq_with_id(set, IqId, NodeAddress, User,  [UnubscribeFromNode]).
   
   create_subscribe_node_stanza(NodeName, From) ->
  -    SubsrNode = create_sub_unsubscribe_from_node_stanza(NodeName, From, <<"subscribe">>),
  -    pubsub_stanza([SubsrNode], ?NS_PUBSUB).
  -
  -create_request_allitems_stanza(NodeName) ->
  -    AllItems = #xmlel{name = <<"items">>, attrs=[{<<"node">>, NodeName}]},
  -    pubsub_stanza([AllItems], ?NS_PUBSUB).
  -
  -%%todo: make one function with option or like with create return always with iq.
  -create_request_allitems_stanza_with_iq(User, IqId, PubSubAddr, NodeName) ->
  -    AllItems = #xmlel{name = <<"items">>, attrs=[{<<"node">>, NodeName}]},
  -    iq_with_id(get, IqId, PubSubAddr, User, [pubsub_stanza([AllItems], ?NS_PUBSUB)]).
  +    create_subscribe_node_stanza(NodeName, From, []).
  +
  +create_subscribe_node_stanza(NodeName, From, Config) ->
  +    SubscrNode = create_sub_unsubscribe_from_node_stanza(NodeName, From, <<"subscribe">>),
  +    Elements = [SubscrNode | case Config of
  +                                 [] -> [];
  +                                 _ -> [subscribe_options_form(Config)]
  +                             end],
  +    pubsub_stanza(Elements, ?NS_PUBSUB).
  +
  +subscribe_options_form(Fields) ->
  +    form(<<"options">>, <<"subscribe_options">>, Fields).
   
   create_unsubscribe_from_node_stanza(NodeName, From) ->
       UnsubsrNode = create_sub_unsubscribe_from_node_stanza(NodeName, From, <<"unsubscribe">>),
  
positive.code: %% ------------ subscribe - unscubscribe -----------
  
  subscribe_by_user_stanza(User, IqId, NodeName, NodeAddress) ->
      SubscribeToNode = create_subscribe_node_stanza(NodeName, User),
      iq_with_id(set, IqId, NodeAddress, User,  [SubscribeToNode]).
  
  unsubscribe_by_user_stanza(User, IqId, NodeName, NodeAddress) ->
  
negative.code: discover_nodes_stanza(User, IqId, NodeAddr, NodeName) ->
      Query = escalus_stanza:query_el(?NS_DISCO_ITEMS, [{<<"node">>, NodeName}], []),
      iq_with_id(get, IqId, NodeAddr, User,  [Query]).
  
  %%-----------------------------------------------------------------------------
  %% Form utils
  %%-----------------------------------------------------------------------------
  
  form(ElemName, FormType, Fields) ->
      #xmlel{name = ElemName,
             children = [#xmlel{name = <<"x">>,
                                attrs = [{<<"xmlns">>, <<"jabber:x:data">>},
                                         {<<"type">>, <<"submit">>}],
                                children = [hidden_field(FormType) | form_fields(Fields)]}
                        ]}.
  
  hidden_field(FormType) ->
      Content = << <<"http://jabber.org/protocol/pubsub#">>/binary, FormType/binary >>,
      #xmlel{name = <<"field">>,
             attrs = [{<<"var">>, <<"FORM_TYPE">>},
                      {<<"type">>, <<"hidden">>}],
             children = [#xmlel{name = <<"value">>,
                                children = [#xmlcdata{content = Content}]}]}.
  
  form_fields(Config) ->
      [#xmlel{name = <<"field">>,
             attrs = [{<<"var">>, Var}],
             children = [#xmlel{name = <<"value">>,
                                children = [#xmlcdata{content = Content}]}]}
       || {Var, Content} <- Config].
  