code: public static Map<String, XAREntry> getXarEntriesMapFromXML(InputStream stream) throws Exception
      {
          SAXReader reader = new SAXReader();
          Document domdoc;
          domdoc = reader.read(stream);
  
          Element filesElement = domdoc.getRootElement().element(FILES_TAG);
  
          if (filesElement == null) {
              throw new Exception("The supplied document contains no document list ");
          }
  
          Map<String, XAREntry> result = new LinkedHashMap<>();
          Collection elements = filesElement.elements(FILE_TAG);
          for (Object item : elements) {
              if (item instanceof Element) {
                  Element currentElement = (Element) item;
  
                  XAREntry entry = new XAREntry();
                  entry.setDocument(currentElement.getText());
                  entry.setType(currentElement.attributeValue("type"));
  
                  result.put(entry.getDocument(), entry);
              }
          }
  
          return result;
      }
docs: Gets the list of entry from a 'package.xml'-like document.
  
  @param stream the XML document to parse
  @return the Map of entries contained in the XML document (ordered in the same order as the file)
  @throws Exception if the XML document is invalid or it contains no document list or it doesn't exist
  @since 10.3