private ModuleDescriptor buildModuleDescriptor(ModuleDescriptor.Builder builder) {
		ModuleDefinition def = moduleRegistry.findDefinition(builder.getModuleName(), builder.getType());
		// null if working in 'recovery' mode where something has gone wrong already, it has
		// been logged but continued processing is attempted to uncover any other issues.
		if (def != null && def.isComposed()) {
			String dsl = ((CompositeModuleDefinition) def).getDslDefinition();
			List<ModuleDescriptor> children = parse(def.getName(), dsl, ParsingContext.module);

			// Preserve the options set for the "parent" module in the parameters map
			Map<String, String> parameters = new HashMap<String, String>(builder.getParameters());

			// Pretend that options were set on the composed module itself
			// (eases resolution wrt defaults later)
			for (ModuleDescriptor child : children) {
				for (String key : child.getParameters().keySet()) {
					String prefix = child.getModuleName() + CompositeModule.OPTION_SEPARATOR;
					builder.setParameter(prefix + key, child.getParameters().get(key));
				}
			}

			// This is to copy options from parent to this (which may override
			// what was set above)
			for (Map.Entry<String, String> entry : parameters.entrySet()) {
				builder.setParameter(entry.getKey(), entry.getValue());
			}

			// Since ModuleDescriptor is immutable, the children created
			// by the parse method above have to be recreated since the group
			// name needs to be modified
			List<ModuleDescriptor> list = new ArrayList<ModuleDescriptor>();
			for (ModuleDescriptor child : children) {
				ModuleDescriptor.Builder childBuilder =
						ModuleDescriptor.Builder.fromModuleDescriptor(child);
				childBuilder.setGroup(builder.getGroup() + "." + child.getModuleName());
				list.add(childBuilder.build());
			}

			builder.addChildren(list);
		}
		return builder.build();
	}
Return a {@link org.springframework.xd.module.ModuleDescriptor}
per the specifications indicated by the provided builder. If the module
is a composite module, the children modules are also built and included
under {@link org.springframework.xd.module.ModuleDescriptor#getChildren()}.

@param builder builder object
@return new instance of {@code ModuleDescriptor}
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/XDStreamParser.java