XSLT for simple Cases

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		version="1.0">
 
  <!--
  xslt stylesheet importing xml data into FileMaker for easy cases
  like:
 
<root>
  <record>
    <field1>....</field1>
    <field2>....</field2>
    <field3>....</field3>
    <... any number of fields ...
  </record>
  ... any number of records
 
  'root', 'record', 'fieldx' can be any names.
  -->
 
  <xsl:template match="/">
 
    <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
 
      <ERRORCODE>0</ERRORCODE>
      <PRODUCT BUILD="" NAME="" VERSION=""/>
      <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="1" 
		TIMEFORMAT="h:mm:ss a"/>
 
      <METADATA>
 
	<!-- Collecting field names 'field1', 'field2', ... as element
	names of first record -->
 
	<xsl:for-each select="/*/*[1]/*">
 
	  <xsl:element name="FIELD">
	    <xsl:attribute name="EMPTYOK">YES</xsl:attribute>
	    <xsl:attribute name="MAXREPEAT">1</xsl:attribute>
	    <xsl:attribute name="NAME">
	      <xsl:value-of select="name()"/>
	    </xsl:attribute>
	  </xsl:element>
 
	</xsl:for-each>
 
	<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="FeldName" TYPE="TEXT"/>
 
      </METADATA>
 
      <RESULTSET FOUND="1">
 
	<!-- calling templates fitting to '/root/record' in sample
	     data above -->
	<xsl:apply-templates select="/*/*"/>
 
      </RESULTSET>
 
    </FMPXMLRESULT>
 
  </xsl:template>
 
 
 
  <xsl:template match="/*/*">
 
    <!-- template matching records on second level. -->
 
 
    <ROW MODID="0" RECORDID="0">
 
      <!-- looping over all children -->
      <xsl:for-each select="*">
 
	<COL>
	  <DATA>
	    <xsl:value-of select="."/>
 	  </DATA>
	</COL>
 
 
      </xsl:for-each>
    </ROW>
 
  </xsl:template>
 
</xsl:stylesheet>