assertEquals("<root><elem>value</elem></root>", xml);
}
public void testSimpleAttribute() throws Exception
{
XmlFactory f = new XmlFactory();
StringWriter out = new StringWriter();
ToXmlGenerator gen = f.createGenerator(out);
// root name is special, need to be fed first:
gen.setNextName(new QName("root"));
gen.writeStartObject();
// and also need to force attribute
gen.setNextIsAttribute(true);