Here you can find the source of parseText(XMLStreamReader parser)
public static String parseText(XMLStreamReader parser) throws XMLStreamException
//package com.java2s; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; public class Main { public static String parseText(XMLStreamReader parser) throws XMLStreamException { for (int event = parser.next(); event != XMLStreamConstants.END_ELEMENT; event = parser.next()) { if (event == XMLStreamConstants.CHARACTERS) return parser.getText(); }//from w w w . ja v a 2s . co m return null; } }