anchor.diff:  		none,
   		[?AST(Mod = get_mod(El)),
   		 ?AST(Mod:do_encode(El, TopXMLNS))]),
  +    JClause1 = erl_syntax:clause(
  +                 [?AST({xmlel, _, _, _} = El)],
  +                 none,
  +                 [?AST(try decode(El) of
  +                           JSON -> encode_json(JSON)
  +                       catch
  +                           _:_ ->
  +                               [<<"XmlString">>, fxml:element_to_binary(El)]
  +                       end)]),
  +    JClause3 = erl_syntax:clause(
  +                 [?AST(El)],
  +                 none,
  +                 [?AST(Mod = get_mod(El)),
  +                  ?AST(Mod:do_encode_json(El))]),
       [make_function(encode, [?AST(El)], [?AST(encode(El, <<>>))]),
        erl_syntax:function(?AST(encode), [Clause1, Clause2, Clause3]),
  +     case proplists:get_bool(json, Opts) of
  +         true ->
  +             erl_syntax:function(?AST(encode_json), [JClause1, JClause3]);
  +         false ->
  +             erl_syntax:comment([])
  +     end,
        make_function(get_name, [?AST(El)], GetNameCase),
        make_function(get_ns, [?AST(El)], GetNSCase),
        make_function(is_known_tag,
  
positive.code: 	      case erl_syntax_lib:analyze_attribute(F) of
  		  {record, {RecName, RecAttrs}} ->
  		      RecAttrs1 = lists:map(
  				    fun({Attr, {Default, _}}) -> {Attr, Default};
  				       ({Attr, Default}) -> {Attr, Default}
  				    end, RecAttrs),
  		      dict:store(RecName, RecAttrs1, Acc);
  		  _ ->
  
negative.code: 		       end,
  		       [Result|Seen]}
                    catch _:_ ->
                            {EncAcc, EncJSONAcc, NSAcc, TagAcc, Seen}
                    end
            end, {[], [], [], [], []}, TaggedSpecs),
      if EncClauses /= [] ->
  	    [erl_syntax:function(?AST(do_encode), EncClauses)];
         true -> []
      end ++
      if EncJSONClauses /= [] ->
  	    [erl_syntax:function(?AST(do_encode_json), EncJSONClauses)];
         true -> []
      end ++
      if TagClauses /= [] ->
  