- for (String instanceName : instanceToRbe.keySet()) {
- ModuleRuntime moduleRuntime = moduleRuntimes.get(localNamespace).get(moduleName);
- Element innerXml = moduleRuntime.toXml(localNamespace, instanceName, instanceToRbe.get(instanceName), document);
- modulesElement.appendChild(innerXml);
+ Element runtimeXml;
+ ModuleConfig moduleConfig = moduleConfigs.get(localNamespace).get(moduleName);
+ if(instanceToRbe==null || !instanceToRbe.containsKey(instanceName)) {
+ runtimeXml = moduleConfig.toXml(instanceON, document, localNamespace);
+ } else {
+ ModuleRuntime moduleRuntime = moduleRuntimes.get(localNamespace).get(moduleName);
+ runtimeXml = moduleRuntime.toXml(localNamespace, instanceToRbe.get(instanceName), document,
+ moduleConfig, instanceON);
+ }
+ modulesElement.appendChild(runtimeXml);