********/
XMLOutputFactory output = XMLOutputFactoryBase.newInstance();
output.setProperty(javax.xml.stream.XMLOutputFactory.IS_REPAIRING_NAMESPACES,new Boolean(true));
Writer myWriter = new java.io.OutputStreamWriter(
new java.io.FileOutputStream("tmp"),"us-ascii");
XMLStreamWriter writer2 = output.createXMLStreamWriter(myWriter);
writer2.writeStartDocument();
writer2.setPrefix("c","http://c");
writer2.setDefaultNamespace("http://d");
writer2.writeStartElement("http://c","a");
writer2.writeAttribute("b","blah");
writer2.writeEmptyElement("http://c","d");
writer2.writeEmptyElement("http://d","e");
writer2.writeEmptyElement("http://e","f");
writer2.writeEmptyElement("http://f","g");
writer2.writeAttribute("http://c","chris","fry");
writer2.writeCharacters("foo bar foo");
writer2.writeCharacters("bad char coming[");
char c = 0x1024;
char[] array = new char[1];
array[0]=c;
writer2.writeCharacters(new String(array));
writer2.writeCharacters("]");
writer2.writeEndElement();
writer2.flush();
}