code: def _convert_metrics_to_xml(metrics, root):
      '''
      <Version>version-number</Version>
      <Enabled>true|false</Enabled>
      <IncludeAPIs>true|false</IncludeAPIs>
      <RetentionPolicy>
          <Enabled>true|false</Enabled>
          <Days>number-of-days</Days>
      </RetentionPolicy>
      '''
      # Version
      ETree.SubElement(root, 'Version').text = metrics.version
  
      # Enabled
      ETree.SubElement(root, 'Enabled').text = str(metrics.enabled)
  
      # IncludeAPIs
      if metrics.enabled and metrics.include_apis is not None:
          ETree.SubElement(root, 'IncludeAPIs').text = str(metrics.include_apis)
  
      # RetentionPolicy
      retention_element = ETree.SubElement(root, 'RetentionPolicy')
      _convert_retention_policy_to_xml(metrics.retention_policy, retention_elementf _convert_metrics_to_xml(metrics, root):
      '''
      <Version>version-number</Version>
      <Enabled>true|false</Enabled>
      <IncludeAPIs>true|false</IncludeAPIs>
      <RetentionPolicy>
          <Enabled>true|false</Enabled>
          <Days>number-of-days</Days>
      </RetentionPolicy>
      '''
      # Version
      ETree.SubElement(root, 'Version').text = metrics.version
  
      # Enabled
      ETree.SubElement(root, 'Enabled').text = str(metrics.enabled)
  
      # IncludeAPIs
      if metrics.enabled and metrics.include_apis is not None:
          ETree.SubElement(root, 'IncludeAPIs').text = str(metrics.include_apis)
  
      # RetentionPolicy
      retention_element = ETree.SubElement(root, 'RetentionPolicy')
      _convert_retention_policy_to_xml(metrics.retention_policy, retention_element)
docs: <Version>version-number</Version>
      <Enabled>true|false</Enabled>
      <IncludeAPIs>true|false</IncludeAPIs>
      <RetentionPolicy>
          <Enabled>true|false</Enabled>
          <Days>number-of-days</Days>
      </RetentionPolicy>