// ... even if with empty value (for CDATA type, at least)
sw = getDTDValidatingWriter(strw, REQUIRED_DTD_STR, nsAware, repairing);
sw.writeStartElement("root");
sw.writeAttribute("reqAttr", "");
sw.writeEndElement();
sw.writeEndDocument();
sw.close();
// and ditto for empty element:
sw = getDTDValidatingWriter(strw, REQUIRED_DTD_STR, nsAware, repairing);
sw.writeEmptyElement("root");