<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_child(parent, tag, text=None):
 """ Add a child element of specified tag type to parent. The new child element is returned. """

    elem = ET.SubElement(parent, tag)
    if text is not None:
        elem.text = text
    return elem