protected ElementNode toElement(ConfigModel config, String ns) { final ElementNode configE = addElement(null, Element.CONFIG.getLocalName(), ns); if(config.getModel() != null) { addAttribute(configE, Attribute.MODEL, config.getModel()); for(Map.Entry<String, String> prop : config.getProperties().entrySet()) { final ElementNode propE = addElement(propsE, Element.PROP.getLocalName(), ns); addAttribute(propE, Attribute.NAME, prop.getKey()); addAttribute(propE, Attribute.VALUE, prop.getValue()); for(Map.Entry<String, ConfigId> dep : config.getConfigDeps().entrySet()) { final ElementNode configDep = addElement(configDeps, Element.CONFIG_DEP.getLocalName(), ns); addAttribute(configDep, Attribute.ID.getLocalName(), dep.getKey()); final ConfigId configId = dep.getValue(); if(configId.getModel() != null) { addAttribute(configDep, Attribute.MODEL.getLocalName(), configId.getModel()); addAttribute(configDep, Attribute.NAME.getLocalName(), configId.getName()); if(!config.isInheritLayers()) { layers = addElement(configE, Element.LAYERS.getLocalName(), ns); addAttribute(layers, Attribute.INHERIT, "false"); addAttribute(layer, Attribute.NAME, layerDep); addAttribute(layer, Attribute.NAME, layerDep);