code: public static XNElement parseXML(XMLStreamReader in) throws XMLStreamException {
          XNElement root = parseXMLFragment(in);
          in.close();
          return root;
      }
docs: Parse an XML from the given XML Stream reader.
  Closes the {@code in} stream.
  @param in the XMLStreamReader
  @return the parsed XElement tree
  @throws XMLStreamException if an error occurs