<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" indent="yes"/>
	<xsl:template match="QUERY">
		<xsl:for-each select="REC">
			<xsl:call-template name="Questions"/>
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="Questions" match="REC">
		<xsl:comment><xsl:value-of select="@PARTREF_"/> | <xsl:value-of select="@PATH_"/></xsl:comment>
		<Question>
			<xsl:attribute name="PartType"><xsl:value-of select="@PARTREF_"/></xsl:attribute>
			<xsl:attribute name="Ref"><xsl:value-of select="@REF_"/></xsl:attribute>
			<xsl:attribute name="DataType"><xsl:value-of select="@TYPE_"/></xsl:attribute>
			<xsl:attribute name="Text">
				<xsl:if test="@AVAILABILITY_">[<xsl:value-of select="@AVAILABILITY_"/>]</xsl:if>
				<xsl:value-of select="@TEXT_"/>
			</xsl:attribute>
		</Question>
	</xsl:template>
</xsl:stylesheet>
