code: public static XElement parseXML(XMLStreamReader in) throws XMLStreamException {
          XElement root = parseXMLFragment(in);
          in.close();
          return root;
      }
docs: Parse an XML from an XML stream reader. Does not close the stream
  @param in the XMLStreamReader object
  @return az XElement object
  @throws XMLStreamException on error