I didn't explain the problem very well....... so....First I wrote this xslt:<?xml version='1.0'?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema' xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'> <xsl:template match="/"> <h1>Data table</h1> <table border="1" bgcolor="#ADFF2F"> <!-- Write all header names to the table --> <tr> <xsl:for-each select="xml/s:Schema/s:ElementType/s:AttributeType"> <xsl:element name="td"> <xsl:attribute name="class">heading</xsl:attribute> <xsl:value-of select="@name"/> </xsl:element> </xsl:for-each> </tr> <!-- Write data into the table --> <xsl:for-each select="/xml/rs:data/rs:insert/z:row" > <xsl:variable name="activedatanode" select="."/> <tr> <xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType"> <td> <xsl:value-of select="@Date"/> </td> <td> <xsl:value-of select="@Time"/> </td> <td> <xsl:value-of select="@TCC18"/> </td> <td> <xsl:value-of select="@TCC19"/> </td> <td> <xsl:value-of select="@TCC20"/> </td> </tr> </xsl:for-each> </table> </xsl:template></xsl:stylesheet>This example outputs the content of attributes named "Date", "Time", "@TCC18", etc. The extension I want to implement now is that these attributes "Date", "Time", ... aren't fix, but they should be read from the xml file in the <s:Schema id='RowsetSchema'> section.So I would like to replace the section: <td> <xsl:value-of select="@Date"/> </td> <td> <xsl:value-of select="@Time"/> </td> <td> <xsl:value-of select="@TCC18"/> </td> <td> <xsl:value-of select="@TCC19"/> </td> <td> <xsl:value-of select="@TCC20"/> </td>by something like: <xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType"> <td> <xsl:variable name="nodename" select="@name"/> <xsl:value-of select="$activedatanode[@*[name()=$nodename]]"/> </td> </xsl:for-each>But this seems not to be correct.....This is the output I need:<table><tr><td class="heading">Date</td><td class="heading">Time</td><td class="heading">TCC18</td><td class="heading">TCC19</td><td class="heading">TCC20</td></tr><tr><td>13.05.2006</td><td>09:15:20</td><td>50</td><td>40</td><td>30</td></tr><tr><td>13.05.2006</td><td>09:15:22</td><td>60</td><td>40</td><td>10</td></tr><tr><td>13.05.2006</td><td>09:15:23</td><td>70</td><td>70</td><td>30</td></tr><tr><td>13.05.2006</td><td>09:15:24</td><td>80</td><td>40</td><td>30</td></tr><tr><td>13.05.2006</td><td>09:15:25</td><td>90</td><td>40</td><td>50</td></tr></table>