anchor.diff:      Stream1 = fxml_stream:parse(Stream0, Data),
       close(Stream1),
       ?assertMatch([{xmlstreamerror, _}], collect_events(CallbackPid)).
  +
  +element_to_binary_entities_test() ->
  +    S = <<"<a b='a&#x9;&#xA;&#xD;&lt;>&amp;&quot;&apos;b'>a&lt;&gt;&amp;&quot;&apos;b</a>">>,
  +    E = #xmlel{name = <<"a">>,
  +	       attrs = [{<<"b">>, <<"a\t\n\r<>&\"'b">>}],
  +	       children = [{xmlcdata, <<"a<>&\"'b">>}]},
  +    R = fxml:element_to_binary(E),
  +    ?assertEqual(S, R),
  +    ?assertEqual(E, fxml_stream:parse_element(R)).
  +
  +element_to_binary_resize_test() ->
  +    A = #xmlel{
  +	   name = <<"a">>,
  +	   children = [{xmlcdata, <<"1234567890123456790123456789012345678901234567890">>}]
  +	  },
  +
  +    ?assertEqual(
  +       <<"<t>",
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "<a>1234567890123456790123456789012345678901234567890</a>"
  +	 "</t>"
  +       >>,
  +       fxml:element_to_binary(
  +	 #xmlel{name = <<"t">>,
  +		children = [A, A, A, A, A,
  +			    A, A, A, A, A,
  +			    A, A, A, A, A,
  +			    A, A, A, A, A]
  +	       })).
   
   element_to_binary_test() ->
       ?assertEqual(
  
positive.code:     ?assertEqual([{xmlstreamend, <<"root">>}], collect_events(CallbackPid)),
      close(Stream6).
  
  too_big_test() ->
      CallbackPid = spawn_link(fun() -> receiver([]) end),
      Stream0 = new(CallbackPid, 5),
  
negative.code: 	    receiver([Msg|Acc]);
  	{get, Parent} ->
  	    Parent ! lists:reverse(Acc),
  	    receiver([]);
  	{close, Parent} ->
  	    Parent ! closed
      end.
  
  collect_events(Pid) ->
  