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)
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.