Java tutorial
//package com.java2s; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { /** * write xml element start tag, data and end tag into XmlStreamWriter * * @param writer * @param element * @param value * @throws XMLStreamException */ public static void writeSimpleDataElement(XMLStreamWriter writer, String element, String value) throws XMLStreamException { writer.writeStartElement(element); writer.writeCharacters(value); writer.writeEndElement(); } }