def _convert_xml_to_service_properties(xml):
service_properties_element = ETree.fromstring(xml)<EOL>service_properties = ServiceProperties()<EOL>logging = service_properties_element.find('<STR_LIT>')<EOL>if logging is not None:<EOL><INDENT>service_properties.logging = Logging()<EOL>service_properties.logging.version = logging.find('<STR_LIT>').text<EOL>service_properties.logging.delete = _bool(logging.find('<STR_LIT>').text)<EOL>service_properties.logging.read = _bool(logging.find('<STR_LIT>').text)<EOL>service_properties.logging.write = _bool(logging.find('<STR_LIT>').text)<EOL>_convert_xml_to_retention_policy(logging.find('<STR_LIT>'), <EOL>service_properties.logging.retention_policy)<EOL><DEDENT>hour_metrics_element = service_properties_element.find('<STR_LIT>')<EOL>if hour_metrics_element is not None:<EOL><INDENT>service_properties.hour_metrics = Metrics()<EOL>_convert_xml_to_metrics(hour_metrics_element, service_properties.hour_metrics)<EOL><DEDENT>minute_metrics_element = service_properties_element.find('<STR_LIT>')<EOL>if minute_metrics_element is not None:<EOL><INDENT>service_properties.minute_metrics = Metrics()<EOL>_convert_xml_to_metrics(minute_metrics_element, service_properties.minute_metrics)<EOL><DEDENT>cors = service_properties_element.find('<STR_LIT>')<EOL>if cors is not None:<EOL><INDENT>service_properties.cors = list()<EOL>for rule in cors.findall('<STR_LIT>'):<EOL><INDENT>allowed_origins = rule.find('<STR_LIT>').text.split('<STR_LIT:U+002C>')<EOL>allowed_methods = rule.find('<STR_LIT>').text.split('<STR_LIT:U+002C>')<EOL>max_age_in_seconds = int(rule.find('<STR_LIT>').text)<EOL>cors_rule = CorsRule(allowed_origins, allowed_methods, max_age_in_seconds)<EOL>exposed_headers = rule.find('<STR_LIT>').text<EOL>if exposed_headers is not None:<EOL><INDENT>cors_rule.exposed_headers = exposed_headers.split('<STR_LIT:U+002C>')<EOL><DEDENT>allowed_headers = rule.find('<STR_LIT>').text<EOL>if allowed_headers is not None:<EOL><INDENT>cors_rule.allowed_headers = allowed_headers.split('<STR_LIT:U+002C>')<EOL><DEDENT>service_properties.cors.append(cors_rule)<EOL><DEDENT><DEDENT>target_version = service_properties_element.find('<STR_LIT>')<EOL>if target_version is not None:<EOL><INDENT>service_properties.target_version = target_version.text<EOL><DEDENT>return service_properties<EOL>
<?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>