Here you can find the source of writeWithCharacters(XMLStreamWriter w, String localName, String text)
public static void writeWithCharacters(XMLStreamWriter w, String localName, String text) throws XMLStreamException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { public static void writeWithCharacters(XMLStreamWriter w, String localName, String text) throws XMLStreamException { w.writeStartElement(localName);//from ww w . j a va 2s . c o m w.writeCharacters(text); w.writeEndElement(); } }