Here you can find the source of CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content) throws XMLStreamException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content) throws XMLStreamException { return CreateSimpleTagAndContent(serializer, tag, content, true); }/* ww w.ja v a 2s.co m*/ public static XMLStreamWriter CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content, boolean allow_empty) throws XMLStreamException { if (!allow_empty && content.equals("")) return serializer; serializer.writeStartElement(tag); serializer.writeCharacters(content); serializer.writeEndElement(); // end simple tag return serializer; } }