public static RawRuntimeModuleDescriptor parseModuleXml(XMLInputFactory factory, InputStream inputStream) throws XMLStreamException {
    XMLStreamReader reader = factory.createXMLStreamReader(inputStream);
    ArrayList<String> dependencies = new ArrayList<>();
    ArrayList<String> resources = new ArrayList<>();
    String moduleName = null;
    int level = 0;
    while (reader.hasNext()) {
      int event = reader.next();
      if (event == XMLStreamConstants.START_ELEMENT) {
        level++;
        String tagName = reader.getLocalName();
        if (level == 1 && tagName.equals(MODULE_TAG)) {
          moduleName = XmlStreamUtil.readFirstAttribute(reader, NAME_ATTRIBUTE);
        }
        else if (level == 3 & tagName.equals(MODULE_TAG)) {
          dependencies.add(XmlStreamUtil.readFirstAttribute(reader, NAME_ATTRIBUTE));
        }
        else if (level == 3 && tagName.equals(RESOURCE_ROOT_TAG)) {
          String relativePath = XmlStreamUtil.readFirstAttribute(reader, PATH_ATTRIBUTE);
          resources.add(relativePath);
        }
      }
      else if (event == XMLStreamConstants.END_ELEMENT) {
        level--;
        if (level == 0) {
          break;
        }
      }
    }
    reader.close();
    if (moduleName == null) {
      throw new XMLStreamException("Required attribute 'module' is not specified");
    }
    return RawRuntimeModuleDescriptor.create(moduleName, resources, dependencies);
  }
public static RawRuntimeModuleDescriptor parseModuleXml(XMLInputFactory factory, InputStream inputStream)