- if (windows_info->product_name) {
- rc = xmlTextWriterWriteElement(writer, "PRODUCTNAME",
- windows_info->product_name);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->edition_id) {
- rc = xmlTextWriterWriteElement(writer, "EDITIONID",
- windows_info->edition_id);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->installation_type) {
- rc = xmlTextWriterWriteElement(writer, "INSTALLATIONTYPE",
- windows_info->installation_type);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->hal) {
- rc = xmlTextWriterWriteElement(writer, "HAL",
- windows_info->hal);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->system_root) {
- rc = xmlTextWriterWriteElement(writer, "SYSTEMROOT",
- windows_info->system_root);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->product_type) {
- rc = xmlTextWriterWriteElement(writer, "PRODUCTTYPE",
- windows_info->product_type);
- if (rc < 0)
- return rc;
- }
-
- if (windows_info->product_suite) {
- rc = xmlTextWriterWriteElement(writer, "PRODUCTSUITE",
- windows_info->product_suite);
- if (rc < 0)
- return rc;
- }
+ rc = xml_write_strings_from_specs(writer,
+ windows_info,
+ windows_info_xml_string_specs,
+ ARRAY_LEN(windows_info_xml_string_specs));
+ if (rc)
+ return rc;