code: public static XElement parseXML(InputStream in) throws XMLStreamException {
          XMLInputFactory inf = XMLInputFactory.newInstance();
          XMLStreamReader ir = inf.createXMLStreamReader(in);
          return parseXML(ir);
      }
docs: Parse an XML document from the given input stream.
  Does not close the stream.
  @param in the input stream
  @return az XElement object
  @throws XMLStreamException on error