}
}
static ModuleSpec parseModuleXml(final ResourceRootFactory factory, final String rootPath, InputStream source, final String moduleInfoFile, final ModuleLoader moduleLoader, final ModuleIdentifier moduleIdentifier) throws ModuleLoadException, IOException {
try {
final MXParser parser = new MXParser();
parser.setFeature(FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(source, null);
return parseDocument(factory, rootPath, parser, moduleLoader, moduleIdentifier);
} catch (XmlPullParserException e) {
throw new ModuleLoadException("Error loading module from " + moduleInfoFile, e);
} finally {
StreamUtil.safeClose(source);