for (int i = 0; i < 3; ++i) {
boolean nsAware = (i >= 1);
boolean repairing = (i == 2);
StringWriter strw = new StringWriter();
XMLStreamWriter2 sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
sw.writeStartElement("root");
// Should be fine now
sw.writeCharacters("Text that should be ok");
sw.writeStartElement("branch");
// Also, all-whitespace is ok in non-mixed too
sw.writeCharacters("\t \t \r \n");