anchor.diff:              []
       end.
   
  -make_ref_enc_funs(Elem, Tag, AllElems) ->
  +make_ref_enc_funs(#elem{xmlns = TopXMLNS} = Elem, Tag, AllElems) ->
       _AccVar = erl_syntax:variable("_acc"),
       _ElsVar = erl_syntax:variable("_els"),
       lists:map(
  
positive.code:                               [erl_syntax:list(
                                   [make_function_call(
                                      make_enc_fun_name([RefName]),
                                      [Var, erl_syntax:list([])])],
                                   _AccVar)]);
                         (#ref{name = RefName, min = 1, max = 1}) ->
                              erl_syntax:clause(
                                [Var, _AccVar],
                                none,
                                [erl_syntax:list(
                                   [make_function_call(
                                      make_enc_fun_name([RefName]),
                                      [Var, erl_syntax:list([])])],
                                   _AccVar)]);
                         (#ref{name = RefName}) ->
                              Pattern =
                                  if length(Refs) > 1 ->
                                          RefElem = get_elem_by_ref(RefName, AllElems),
                                          erl_syntax:match_expr(
                                            labels_to_underscores(
                                              RefElem#elem.result),
  
negative.code:                   lists:map(
                      fun(#ref{name = RefName,
                               min = 0, max = 1}) ->
                              RefElem = get_elem_by_ref(RefName, AllElems),
                              XMLNS = RefElem#elem.xmlns,
                              XMLNSAttrs = if TopXMLNS == XMLNS ->
                                                   erl_syntax:list([]);
                                              true ->
                                                   erl_syntax:list(
                                                     [erl_syntax:tuple(
                                                        [abstract(<<"xmlns">>),
                                                         abstract(XMLNS)])])
                                           end,
                              Pattern =
                                  if length(Refs) > 1 ->
                                          MatchVar = erl_syntax:match_expr(
                                                       labels_to_underscores(
                                                         RefElem#elem.result),
  