sw.writeStartElement("root?");
sw.writeAttribute("attr", "value");
sw.writeAttribute("another", "this & that");
//sw.writeAttribute("attr", "whatever"); // error!
sw.writeStartElement(null, "elem");
sw.writeCharacters("Sub-text");
sw.writeEndElement();
//sw.writeStartElement("elem3:foo"); // error, colon inside local name
sw.writeStartElement("elem3");
sw.writeEndElement();
//sw.writeCharacters("Root text <> ]]>\n");