Java tutorial
//package com.java2s; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { public static void writeValue(XMLStreamWriter writer, String name, String value) throws XMLStreamException { writer.writeStartElement(name); writer.writeCharacters(value); writer.writeEndElement(); } }