boolean repairing = (i == 2);
StringWriter strw = new StringWriter();
XMLStreamWriter2 sw = getDTDValidatingWriter(strw, SIMPLE_DTD, nsAware, repairing);
sw.writeStartElement("root");
sw.writeCharacters(" "); // imitating indentation
sw.writeStartElement("branch");
sw.writeEndElement();
sw.writeStartElement("branch");
sw.writeCharacters("test");
sw.writeComment("comment");