Extract all the options of a select element.
protected function getAllOptionsList($element) {
$options = array();
// Add all options items.
foreach ($element->option as $option) {
$options[] = (string) $option['value'];
}
// TODO: support optgroup.
return $options;
}