use not for-each
xsl is not a programming language
think in xslt
use style tag for css
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="html"/>
<xsl:template match="/">
<html>
<style>
table.ContentHeaderSection {
cellpadding :0;
cellspacing :0;
width :100%;
height :100%;
border :2px solid black;
text-align :center;
}
table.Content {
width :60%;
height :60%;
cellspacing :1;
cellpadding :4;
background-color:#FFFF00;
border :2px solid black;
text-align :center;
margin-top:120px;
}
</style>
<body>
<xsl:apply-templates select="Rowsets"/>
</body>
</html>
</xsl:template>
<xsl:template match="Rowsets">
<xsl:apply-templates select="Rowset"/>
</xsl:template>
<xsl:template match="Rowset">
<xsl:apply-templates select="Columns"/>
</xsl:template>
<xsl:template match="Columns">
<table class="ContentHeaderSection">
<tr>
<td>
<table class="Content" >
<tr>
<th colspan="2" class="ContentSubTitleBar ContentSubTitle">In Process Batch Details</th>
</tr>
<tr>
<td>
<xsl:apply-templates select="Column"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="Column">
<tr>
<td>
<xsl:value-of select="@Name"/>
</td>
<xsl:variable name="BatchDetails" select="@Name"/>
<td>
<xsl:value-of select="../../Row/*[local-name()=$BatchDetails]"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>