<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def etree_write(tree, stream):
 """ Write XML ElementTree 'root' content into 'stream'. :param tree: XML ElementTree object :param stream: File or file-like object can write to """

    try:
        tree.write(stream, encoding="utf-8", xml_declaration=True)
    except TypeError:
        tree.write(stream, encoding="unicode", xml_declaration=True)