}
@Test
public void element_nesting()
{
MarkupWriter w = new MarkupWriterImpl();
Element root = w.element("root");
w.attributes("foo", "bar");
w.write("before child");
assertNotSame(w.element("nested"), root);
w.write("inner text");
assertSame(w.end(), root);
w.write("after child");
root.attribute("gnip", "gnop");
assertEquals(w.toString(),
"<root foo=\"bar\" gnip=\"gnop\">before child<nested>inner text</nested>after child</root>");
}