code: private int renderUnorderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options,
  			final int startIndex,
  			final XmlStringBuilder xml, final boolean renderSelectionsOnly) {
  		List<?> selections = multiSelectPair.getSelected();
  		int optionIndex = startIndex;
  
  		for (Object option : options) {
  			if (option instanceof OptionGroup) {
  				xml.appendTagOpen("ui:optgroup");
  				xml.appendAttribute("label", ((OptionGroup) option).getDesc());
  				xml.appendClose();
  
  				// Recurse to render options inside option groups.
  				List<?> nestedOptions = ((OptionGroup) option).getOptions();
  				optionIndex += renderUnorderedOptions(multiSelectPair, nestedOptions, optionIndex,
  						xml, renderSelectionsOnly);
  
  				xml.appendEndTag("ui:optgroup");
  			} else {
  				renderOption(multiSelectPair, option, optionIndex++, xml, selections,
  						renderSelectionsOnly);
  			}
  		}
  
  		return optionIndex - startIndex;
  	}
docs: Renders the options in list order.
  
  @param multiSelectPair the WMultiSelectPair to paint.
  @param options the options to render
  @param startIndex the starting option index
  @param xml the XmlStringBuilder to paint to.
  @param renderSelectionsOnly true to only render selected options, false to render all options.
  
  @return the number of options which were rendered.