<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_user_input(prompt, key_name, parent, input_func=raw_input):
 """Prompt the user for a value, and assign it to key_name."""

    val = input_func(prompt)
    ElementTree.SubElement(parent, "key").text = key_name
    if isinstance(val, bool):
        string_val = "true" if val else "false"
        ElementTree.SubElement(parent, string_val)
    else:
        ElementTree.SubElement(parent, "string").text = val
    return val