anchor.diff:                        Tags = dict:fetch(H, RecNames),
   		      OtherResults = dict:fetch(H, ResNames) -- [Result],
   		      true = lists:member(Tag, Tags),
  -		      false = lists:member(Result, OtherResults),
  -                      XMLNSAttrs = if IgnoreXMLNS or HasXMLNSAttr or is_list(XMLNS) ->
  +		      IsDuplicated = lists:member(Result, OtherResults),
  +		      AlreadySeen = lists:member(Result, Seen),
  +                      XMLNSAttrs = if IgnoreXMLNS or HasXMLNSAttr
  +				      or is_list(XMLNS) or IsDuplicated ->
                                              erl_syntax:list([]);
                                         true ->
                                              erl_syntax:list(
  
positive.code: 		       erl_syntax:variable("El"))],
  		    none,
  		    [erl_syntax:variable("El")]),
      [erl_syntax:function(erl_syntax:atom("encode"), [XmlElClause|Clauses])].
  
  make_printer(TaggedSpecs) ->
      PassClause = erl_syntax:clause(
  
negative.code: 			  {RecAcc, ResAcc}
  		  end
  	  end, {dict:new(), dict:new()}, TaggedSpecs),
      NilNSClause = erl_syntax:clause(
  		    [erl_syntax:underscore()], none, [abstract(<<"">>)]),
      {EncClauses, NSClauses, _} =
          lists:foldl(
            fun({Tag, #elem{name = Name, xmlns = XMLNS,
  			  result = Result, attrs = Attrs}},
  	      {EncAcc, NSAcc, Seen}) ->
                    NewResult = labels_to_underscores(Result),
                    Var = label_to_var(prepare_label(undefined, Name)),
  		  HasXMLNSAttr = lists:any(
  