def parse_options_xml(root):
options = []<EOL>correct_option = None<EOL>rationale = None<EOL>for option_el in root.findall('<STR_LIT>'):<EOL><INDENT>option_dict = dict()<EOL>option_prompt_el = option_el.find('<STR_LIT:text>')<EOL>if option_prompt_el is not None:<EOL><INDENT>option_dict['<STR_LIT:text>'] = _safe_get_text(option_prompt_el)<EOL><DEDENT>else:<EOL><INDENT>raise ValidationError(_('<STR_LIT>'))<EOL><DEDENT>option_dict.update(parse_image_xml(option_el))<EOL>if '<STR_LIT>' in option_el.attrib and _parse_boolean(option_el.attrib['<STR_LIT>']):<EOL><INDENT>if correct_option is None:<EOL><INDENT>correct_option = len(options)<EOL>rationale_el = option_el.find('<STR_LIT>')<EOL>if rationale_el is not None:<EOL><INDENT>rationale = {'<STR_LIT:text>': _safe_get_text(rationale_el)}<EOL><DEDENT>else:<EOL><INDENT>raise ValidationError(_('<STR_LIT>'))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValidationError(_('<STR_LIT>'))<EOL><DEDENT><DEDENT>options.append(option_dict)<EOL><DEDENT>if correct_option is None or rationale is None:<EOL><INDENT>raise ValidationError(_('<STR_LIT>'))<EOL><DEDENT>return options, correct_option, rationale<EOL>
Parse <options> element in the UBCPI XBlock's content XML.

Args:
    root (lxml.etree.Element): The root of the <options> node in the tree.

Returns:
    a list of deserialized representation of options. E.g.
    [{
        'text': 'Option 1',
        'image_url': '',
        'image_position': 'below',
        'image_show_fields': 0,
        'image_alt': ''
    },
    {....
    }]

Raises:
    ValidationError: The XML definition is invalid.