anchor.diff:                                   none,
                                    [make_function_call(
                                       FunName,
  -                                    [_ElsVar|CDataVars ++ ElemVars] ++
  +                                    [erl_syntax:variable("__TopXMLNS"),
  +				     _ElsVar|CDataVars ++ ElemVars] ++
                                           [erl_syntax:list(
                                              [make_function_call(
                                                 "decode",
  
positive.code:         end,
      PassClause = if SubElVars == []; CDataVars == [] ->
                           [erl_syntax:clause(
                              [erl_syntax:list(
                                 [erl_syntax:underscore()],
                                 _ElsVar)|CDataVars ++ ElemVars ++ SubElVars ++ XmlElVars],
                              none,
                              [make_function_call(
                                 FunName,
                                 [_ElsVar|CDataVars ++ ElemVars ++ SubElVars ++ XmlElVars])])];
                      true ->
                           []
                   end,
  
negative.code:               Label = prepare_label(RefLabel, RefName),
                Var = label_to_var(Label),
                RefElem = get_elem_by_ref(RefName, AllElems),
                XMLNSs = lists:flatten([RefElem#elem.xmlns]),
  	      TopXMLNSs = lists:flatten([TopXMLNS]),
  	      HasCommonXMLNSs = not sets:is_disjoint(
  				      sets:from_list(XMLNSs),
  				      sets:from_list(TopXMLNSs)),
                XMLNSMatch = erl_syntax:match_expr(
                               erl_syntax:variable("_xmlns"),
                               make_function_call(
                                 get_attr,
                                 [abstract(<<"xmlns">>),
                                  erl_syntax:variable("_attrs")])),
                IfGuard = case HasCommonXMLNSs of
  			    false ->
                                  erl_syntax:disjunction(
  				  [erl_syntax:infix_expr(
  				     erl_syntax:variable("_xmlns"),
  				     erl_syntax:operator("=="),
  				     abstract(NS)) || NS <- XMLNSs]);
  			    true ->
  				erl_syntax:disjunction(
  				  [erl_syntax:infix_expr(
  				     erl_syntax:variable("_xmlns"),
  				     erl_syntax:operator("=="),
  				     abstract(<<"">>)),
  				   erl_syntax:infix_expr(
  				     erl_syntax:variable("_xmlns"),
  				     erl_syntax:operator("=="),
  				     erl_syntax:variable("__TopXMLNS"))])
  			end,
                NewElemVars =
  		  fun(NS) ->
  			  lists:map(
  			    fun({L, [#ref{min = Min, max = 1}|_]})
  				  when L == Label ->
  				    Call = make_function_call(
  					     make_dec_fun_name([RefName]),
  					     [erl_syntax:variable(NS),
  					      erl_syntax:variable("_el")]),
  				    if Min == 0 ->
  					    Call;
  				       Min == 1 ->
  					    erl_syntax:tuple(
  					      [erl_syntax:atom("value"),
  					       Call])
  				    end;
  			       ({L, [#ref{default = Def}]}) when L == Label ->
  				    RefType = dict:fetch(RefName, Types),
  				    case is_subtype(Def, RefType) of
  					true ->
  					    erl_syntax:case_expr(
  					      make_function_call(
  						make_dec_fun_name([RefName]),
  						[erl_syntax:variable(NS),
  						 erl_syntax:variable("_el")]),
  					      [erl_syntax:clause(
  						 [abstract(Def)], none, [Var]),
  					       erl_syntax:clause(
  						 [erl_syntax:variable("_new_el")],
  						 none,
  						 [erl_syntax:list(
  						    [erl_syntax:variable("_new_el")],
  						    Var)])]);
  					false ->
  					    erl_syntax:list(
  					      [make_function_call(
  						 make_dec_fun_name([RefName]),
  						 [erl_syntax:variable(NS),
  						  erl_syntax:variable("_el")])],
  					      Var)
  				    end;
  			       ({L, _}) ->
  				    label_to_var(L)
  			    end, group_refs(Refs))
  		  end,
                erl_syntax:clause(
                  [erl_syntax:variable("__TopXMLNS"),
  		 erl_syntax:list(
                     [erl_syntax:match_expr(
                        erl_syntax:tuple(
                          [erl_syntax:atom("xmlel"),
  