'Create a <stringresponse> XML element.
Uses **kwargs:
*answer*: The correct answer (a string) [REQUIRED]
*case_sensitive*: Whether the response is case-sensitive (True/False)
[DEFAULT: True]
*hints*: List of (hint_prompt, hint_name, hint_text) tuples
Where *hint_prompt* is the string for which we show the hint,
*hint_name* is an internal identifier for the hint,
and *hint_text* is the text we show for the hint.
*hintfn*: The name of a function in the script to use for hints.
*regexp*: Whether the response is regexp
*additional_answers*: list of additional answers.
*non_attribute_answers*: list of additional answers to be coded in the
non-attribute format'

def create_response_element(self, **kwargs):

    answer = kwargs.get('answer', None)
    case_sensitive = kwargs.get('case_sensitive', None)
    hint_list = kwargs.get('hints', None)
    hint_fn = kwargs.get('hintfn', None)
    regexp = kwargs.get('regexp', None)
    additional_answers = kwargs.get('additional_answers', [])
    non_attribute_answers = kwargs.get('non_attribute_answers', [])
    assert answer
    response_element = etree.Element('stringresponse')
    response_element.set('answer', unicode(answer))
    type_value = ''
    if (case_sensitive is not None):
        type_value += ('cs' if case_sensitive else 'ci')
    type_value += ('    regexp' if regexp else '')
    if type_value:
        response_element.set('type', type_value.strip())
    if (hint_list or hint_fn):
        hintgroup_element = etree.SubElement(response_element, 'hintgroup')
        if hint_list:
            assert (not hint_fn)
            for (hint_prompt, hint_name, hint_text) in hint_list:
                stringhint_element = etree.SubElement(hintgroup_element, 'stringhint')
                stringhint_element.set('answer', str(hint_prompt))
                stringhint_element.set('name', str(hint_name))
                hintpart_element = etree.SubElement(hintgroup_element, 'hintpart')
                hintpart_element.set('on', str(hint_name))
                hint_text_element = etree.SubElement(hintpart_element, 'text')
                hint_text_element.text = str(hint_text)
        if hint_fn:
            assert (not hint_list)
            hintgroup_element.set('hintfn', hint_fn)
    for additional_answer in additional_answers:
        additional_node = etree.SubElement(response_element, 'additional_answer')
        additional_node.set('answer', additional_answer)
    for answer in non_attribute_answers:
        additional_node = etree.SubElement(response_element, 'additional_answer')
        additional_node.text = answer
    return response_element
