anchor.diff:  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].
  
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:     escalus_pubsub_stanza:iq_with_id(set, IqId, NodeAddress, User,  [UnubscribeFromNode]).
  
  create_subscribe_node_stanza(NodeName, From) ->
      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">>),
  