// And then using empty element write method(s)
sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
sw.writeEmptyElement("root");
// note: empty element need/can not be closed
sw.writeEndDocument();
sw.close();
// and finally empty with attribute
sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
sw.writeEmptyElement("root");