s" />

  <!-- ============================================ -->
  <!-- ========== VARIABLE SECTION START ========== -->
  <!-- ============================================ -->
  <xsl:variable name="NEWLINE">
    <xsl:text>&#xA;</xsl:text>
  </xsl:variable>
  <xsl:key name="distinct-device" match="Device" use="InstalledDriver/@model"/>
  <xsl:variable name="LOWERCASE" select="'abcdefghijklmnopqrstuvwxyz'" />
  <xsl:variable name="UPPERCASE" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
  <!-- ========================================== -->
  <!-- ========== VARIABLE SECTION END ========== -->
  <!-- ========================================== -->


  <xsl:template match="/">
    <xsl:if test="//SystemSpec">
      <xsl:call-template name="DeviceList" />
    </xsl:if>
  </xsl:template>

  <!-- ====================================== -->
  <!-- ========== DeviceList START ========== -->
  <!-- ====================================== -->
  <xsl:template name="DeviceList">
    <!-- ====================================== -->
    <!-- ============ Areas START ============= -->
    <!-- ====================================== -->

    <xsl:element name="Areas">

      <xsl:for-each select="//Device[generate-id()=generate-id(key('distinct-device',InstalledDriver/@model)[1])]">


        <!-- =========================================================== -->
        <!-- == Exclude any of the following device classes.          == -->
        <!-- =========================================================== -->

        <xsl:if test="InstalledDriver/@class!='System'">
          <xsl:if test="InstalledDriver/@class!='hdc'">
            <xsl:if test="InstalledDriver/@class!='USB'">
              <xsl:if test="InstalledDriver/@class!='Processor'">
                <xsl:if test="InstalledDriver/@class!='Computer'">
                  <xsl:if test="InstalledDriver/@class!='Ports'">
                    <xsl:if test="InstalledDriver/@class!='fdc'">
                      <xsl:if test="InstalledDriver/@class!='HIDClass'">

                        <xsl:element name="Area">

                          <xsl:attribute name="id">
                            <xsl:value-of select="concat(InstalledDriver/@classDescription,' (',InstalledDriver/@model,')' )" />
                          </xsl:attribute>

                          <xsl:attribute name="text">
                            <xsl:value-of select="concat(InstalledDriver/@classDescription,' (',InstalledDriver/@model,')' )" />
                          </xsl:attribute>

                          <xsl:attribute name="keywords">
                            <xsl:value-of select="concat(InstalledDriver/@classDescription,' (',InstalledDriver/@model,')' )" />
                          </xsl:attribute>

                          <!-- =================================== -->
                          <!-- == Select the first Hardware ID  == -->
                          <!-- =================================== -->
                          <xsl:element name="StaticValue">
                            <xsl:attribute name="id">
                              <xsl:value-of select="'HardwareID'" />
                            </xsl:attribute>
                            <xsl:attribute name="value">
                              <xsl:value-of select="HWID[1]" />
                            </xsl:attribute>
                          </xsl:element>

                          <xsl:element name="StaticValue">
                            <xsl:attribute name="id">
                              <xsl:value-of select="'DriverName'" />
                            </xsl:attribute>
                            <xsl:attribute name="value">
                              <xsl:value-of select="InstalledDriver/@fileName" />
                            </xsl:attribute>
                          </xsl:element>

                          <xsl:element name="StaticValue">
                            <xsl:attribute name="id">
                              <xsl:value-of select="'DriverVersion'" />
                            </xsl:attribute>
                            <xsl:attribute name="value">
                              <xsl:value-of select="InstalledDriver/@driverVerVersion" />
                            </xsl:attribute>
                          </xsl:element>
                        </xsl:element>

                      </xsl:if>
                    </xsl:if>
                  </xsl:if>
                </xsl:if>
              </xsl:if>
            </xsl:if>
          </xsl:if>
        </xsl:if>

      </xsl:for-each>

    </xsl:element>

    <!-- ====================================== -->
    <!-- ============ Areas END ============= -->
    <!-- ====================================== -->

  </xsl:template>
  <!-- ====================================== -->
  <!-- ========== DeviceList END ============ -->
  <!-- ====================================== -->

</xsl:stylesheet>



