anchor.diff:          true = is_atom(RecordName),
           false = is_label(RecordName),
           true = lists:all(fun is_label/1, RecordFields),
  -        [erl_syntax:attribute(
  -           erl_syntax:atom("record"),
  -           [erl_syntax:atom(atom_to_list(RecordName)),
  -            erl_syntax:tuple(
  -              lists:map(
  -                fun(Label) ->
  -                        Field = label_to_record_field(Label),
  -                        case get_spec_by_label(Label, Elem) of
  -                            #ref{default = Default,
  -                                 min = 0, max = 1}
  -                              when Default /= undefined ->
  -                                erl_syntax:match_expr(
  -                                  Field,
  -                                  erl_syntax:abstract(Default));
  -                            #ref{max = Max} when Max > 1 ->
  -                                erl_syntax:match_expr(
  -                                  Field,
  -                                  erl_syntax:abstract([]));
  -                            #attr{default = Default}
  -                              when Default /= undefined ->
  -                                erl_syntax:match_expr(
  -                                  Field,
  -                                  erl_syntax:abstract(Default));
  -                            #cdata{default = Default}
  -                              when Default /= undefined ->
  -                                erl_syntax:match_expr(
  -                                  Field,
  -                                  erl_syntax:abstract(Default));
  -                            sub_els ->
  -                                erl_syntax:match_expr(
  -                                  Field,
  -                                  erl_syntax:abstract([]));
  -                            _ ->
  -                                Field
  -                        end
  -                end, RecordFields))])]
  +        [{RecordName,
  +          erl_syntax:attribute(
  +            erl_syntax:atom("record"),
  +            [erl_syntax:atom(atom_to_list(RecordName)),
  +             erl_syntax:tuple(
  +               lists:map(
  +                 fun(Label) ->
  +                         Field = label_to_record_field(Label),
  +                         case get_spec_by_label(Label, Elem) of
  +                             #ref{default = Default,
  +                                  min = 0, max = 1}
  +                               when Default /= undefined ->
  +                                 erl_syntax:match_expr(
  +                                   Field,
  +                                   erl_syntax:abstract(Default));
  +                             #ref{max = Max} when Max > 1 ->
  +                                 erl_syntax:match_expr(
  +                                   Field,
  +                                   erl_syntax:abstract([]));
  +                             #attr{default = Default}
  +                               when Default /= undefined ->
  +                                 erl_syntax:match_expr(
  +                                   Field,
  +                                   erl_syntax:abstract(Default));
  +                             #cdata{default = Default}
  +                               when Default /= undefined ->
  +                                 erl_syntax:match_expr(
  +                                   Field,
  +                                   erl_syntax:abstract(Default));
  +                             sub_els ->
  +                                 erl_syntax:match_expr(
  +                                   Field,
  +                                   erl_syntax:abstract([]));
  +                             _ ->
  +                                 Field
  +                         end
  +                 end, RecordFields))])}]
       catch _:_ ->
               []
       end.
  
positive.code:                     erl_syntax:underscore()],
                     none,
                     [erl_syntax:atom("no")]),
      Clauses =
          lists:foldl(
            fun({_Tag, #elem{result = Result}}, Acc) ->
                    try
                        [H|T]= tuple_to_list(Result),
                        true = is_atom(H),
                        false = is_label(H),
                        true = lists:all(fun is_label/1, T),
                        [erl_syntax:clause(
                           [erl_syntax:atom(H), abstract(length(T))],
  
negative.code:           Clauses ++ [NilClause])])].
  
  make_top_encoders(TaggedSpecs) ->
      RecNames = lists:foldl(
                   fun({Tag, #elem{result = Result}}, Acc) ->
                           try
                               [H|_]= tuple_to_list(Result),
                               true = is_atom(H),
                               false = is_label(H),
                               dict:append(H, Tag, Acc)
                           catch _:_ ->
                                   Acc
                           end
                   end, dict:new(), TaggedSpecs),
      Clauses =
          lists:flatmap(
            fun({Tag, #elem{name = Name, xmlns = XMLNS, result = Result}}) ->
  