<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def str_to_etree(xml_str, encoding='utf-8'):
 """Deserialize API XML doc to an ElementTree. Args: xml_str: bytes DataONE API XML doc encoding: str Decoder to use when converting the XML doc ``bytes`` to a Unicode str. Returns: ElementTree: Matching the API version of the XML doc. """

    parser = xml.etree.ElementTree.XMLParser(encoding=encoding)
    return xml.etree.ElementTree.fromstring(xml_str, parser=parser)