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