code: def put_motion_detection_xml(self, xml):
          
  
          _LOGGING.debug('xml:')
          _LOGGING.debug("%s", xml)
  
          headers = DEFAULT_HEADERS
          headers['Content-Length'] = len(xml)
          headers['Host'] = self._host
          response = requests.put(self.motion_url, auth=HTTPBasicAuth(
              self._username, self._password), data=xml, headers=headers)
          _LOGGING.debug('request.headers:')
          _LOGGING.debug('%s', response.request.headers)
          _LOGGING.debug('Response:')
          _LOGGING.debug('%s', response.text)
  
          if response.status_code != 200:
              _LOGGING.error(
                  "There was an error connecting to %s", self.motion_url)
              _LOGGING.error("status_code %s", response.status_code)
              return
  
          try:
              tree = ElementTree.fromstring(response.text)
              enabled_element = tree.findall(
                  './/{%s}statusString' % self._xml_namespace)
              if len(enabled_element) == 0:
                  _LOGGING.error("Problem getting motion detection status")
                  return
  
              if enabled_element[0].text.strip() == 'OK':
                  _LOGGING.info('Updated successfully')
  
          except AttributeError as attib_err:
              _LOGGING.error(
                  'There was a problem parsing the response: %s', attib_err)
              return
docs: Put request with xml Motion Detection