code: public static XElement parseXMLFragment(XMLStreamReader in) throws XMLStreamException {
          if (in.hasNext()) {
              in.next();
              return parseXMLActiveFragment(in);
          }
          return null;
      }
docs: Parse an XML from an XML stream reader. Does not close the stream
  @param in the XMLStreamReader object
  @return the XElement object
  @throws XMLStreamException on error