I have xml with the following data.
<Rows>
<Header>
<sourcetable>Table_1</sourcetable>
<targettable>Table_2</targettable>
</Header>
<Table>
<Source_Fieldname>DTIME_INSERTED</Source_Fieldname>
<Source_Type>Timestamp</Source_Type>
<Source_Fieldname>ID_JOB</Source_Fieldname>
<Source_Type>String</Source_Type>
</Table>
<Header>
<sourcetable>Table_3</sourcetable>
<targettable>Table_4</targettable>
</Header>
<Table>
<Source_Fieldname>DTIME_INSERTED</Source_Fieldname>
<Source_Type>Timestamp</Source_Type>
<Source_Fieldname>ID_JOB</Source_Fieldname>
<Source_Type>String</Source_Type>
</Table>
</Rows>
I am trying to output this into separate tables per "Table" element just like this but can't figure it out since there are multiple elements with the same name.

So far this is what I got.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="Row">
<table border="1px" cellpadding="3" cellspacing="1" style='font-family:"Calibri"; font-size:12; font-weight:"normal"' >
<tr align="center">
<xsl:for-each select="preceding-sibling::Header[1]">
<th colspan="4" bgcolor="#ccffff">
<font size="2" face="Calibri" style="text-transform:uppercase"> <xsl:value-of select="sourcetable" /> </font>
</th>
<th colspan="4" bgcolor="#ccffff">
<font size="2" face="Calibri" style="text-transform:uppercase"> <xsl:value-of select="targettable" /> </font>
</th>
</xsl:for-each>
<th bgcolor="#FFCCBC" rowspan="2">Flagfield</th>
</tr>
<tr align="left">
<td bgcolor="#C5E1A5">Source_Fieldname</td>
<td bgcolor="#C5E1A5">Source_Type</td>
</tr>
<xsl:for-each select=".">
<tr>
<xsl:for-each select="Source_Fieldname">
<td> <xsl:value-of select="."/> </td>
</xsl:for-each>
<xsl:for-each select="Source_Type">
<td> <xsl:value-of select="."/> </td>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
<br /><br/>
</xsl:template>
</xsl:stylesheet>
Any suggestion how to achieve desired output is appreciated. Thanks!
