docs: def _convert_xml_to_service_properties(xml):
      '''
      <?xml version="1.0" encoding="utf-8"?>
      <StorageServiceProperties>
          <Logging>
              <Version>version-number</Version>
              <Delete>true|false</Delete>
              <Read>true|false</Read>
              <Write>true|false</Write>
              <RetentionPolicy>
                  <Enabled>true|false</Enabled>
                  <Days>number-of-days</Days>
              </RetentionPolicy>
          </Logging>
          <HourMetrics>
              <Version>version-number</Version>
              <Enabled>true|false</Enabled>
              <IncludeAPIs>true|false</IncludeAPIs>
              <RetentionPolicy>
                  <Enabled>true|false</Enabled>
                  <Days>number-of-days</Days>
              </RetentionPolicy>
          </HourMetrics>
          <MinuteMetrics>
              <Version>version-number</Version>
              <Enabled>true|false</Enabled>
              <IncludeAPIs>true|false</IncludeAPIs>
              <RetentionPolicy>
                  <Enabled>true|false</Enabled>
                  <Days>number-of-days</Days>
              </RetentionPolicy>
          </MinuteMetrics>
          <Cors>
              <CorsRule>
                  <AllowedOrigins>comma-separated-list-of-allowed-origins</AllowedOrigins>
                  <AllowedMethods>comma-separated-list-of-HTTP-verb</AllowedMethods>
                  <MaxAgeInSeconds>max-caching-age-in-seconds</MaxAgeInSeconds>
                  <ExposedHeaders>comma-seperated-list-of-response-headers</ExposedHeaders>
                  <AllowedHeaders>comma-seperated-list-of-request-headers</AllowedHeaders>
              </CorsRule>
          </Cors>
      </StorageServiceProperties>
      '''
      service_properties_element = ETree.fromstring(xml)
      service_properties = ServiceProperties()
      
      # Logging
      logging = service_properties_element.find('Logging')
      if logging is not None:
          service_properties.logging = Logging()
          service_properties.logging.version = logging.find('Version').text
          service_properties.logging.delete = _bool(logging.find('Delete').text)
          service_properties.logging.read = _bool(logging.find('Read').text)
          service_properties.logging.write = _bool(logging.find('Write').text)
  
          _convert_xml_to_retention_policy(logging.find('RetentionPolicy'), 
                                              service_properties.logging.retention_policy)
      # HourMetrics
      hour_metrics_element = service_properties_element.find('HourMetrics')
      if hour_metrics_element is not None:
          service_properties.hour_metrics = Metrics()
          _convert_xml_to_metrics(hour_metrics_element, service_properties.hour_metrics)
  
      # MinuteMetrics
      minute_metrics_element = service_properties_element.find('MinuteMetrics')
      if minute_metrics_element is not None:
          service_properties.minute_metrics = Metrics()
          _convert_xml_to_metrics(minute_metrics_element, service_properties.minute_metrics)
  
      # CORS
      cors = service_properties_element.find('Cors')
      if cors is not None:
          service_properties.cors = list()
          for rule in cors.findall('CorsRule'):
              allowed_origins = rule.find('AllowedOrigins').text.split(',')
  
              allowed_methods = rule.find('AllowedMethods').text.split(',')
  
              max_age_in_seconds = int(rule.find('MaxAgeInSeconds').text)
  
              cors_rule = CorsRule(allowed_origins, allowed_methods, max_age_in_seconds)
  
              exposed_headers = rule.find('ExposedHeaders').text
              if exposed_headers is not None:
                  cors_rule.exposed_headers = exposed_headers.split(',')
  
              allowed_headers = rule.find('AllowedHeaders').text
              if allowed_headers is not None:
                  cors_rule.allowed_headers = allowed_headers.split(',')
  
              service_properties.cors.append(cors_rule)
  
      # Target version
      target_version = service_properties_element.find('DefaultServiceVersion')
      if target_version is not None:
          service_properties.target_version = target_version.text
  
      return service_properties