#set ($idParam = ${language.getParam("id", $item.id)})
#set ($name = $item.name)
#if (!($name and $name != "") and $item.input and $item.input.name)
    #set ($name = "${" + $item.input.name + "}")
#end
#set ($nameParam = ${language.getParam("name", $name)})
## TODO $item.itemValidations
#if($item.output)
  #if($item.output.name)
    #set($nameParam = ${language.getParam("name", $item.output.name)})
  #end
#end

<xforms:select selectUI="listbox" #if($idParam)$idParam#end#if($nameParam)$nameParam#end xmlns:xforms="http://www.w3.org/2002/01/xforms"> 
  #if($valueParam)
    <xforms:caption xmlns:xforms="http://www.w3.org/2002/01/xforms">$valueParam</xforms:caption>
  #end
  #if ($item.elements)
    #foreach ($option in $item.elements)
      ${language.translateItem($option)}
    #end
  #elseif ($item.elementsPopulationScript)
    ${language.toServerScript($item.elementsPopulationScript)}
  #end
</xforms:select>
