The idea is to output a row with two columns - [CODE] [QUOTATION] - actually repeating the [CODE] name every row, so that it can be exported to something like Calc/Excel.
I tried nesting the two <xsl:for-each select>, but for some reason, the line responsible for outputing the [CODE] name, <xsl:value-of select="@name"/> doesn't seem to output anything if it is nested as such. Otherwise, it works (if I move the above line outside the for-each). Any suggestions?

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<xsl:output method="xml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
omit-xml-declaration="yes" indent="yes" />

<xsl:variable name= "maxquotesize">10000</xsl:variable>

<xsl:variable name= "description" select="document('')//atlasDescription" />

<xsl:include href="_shared.xsl.inc"/>
<xsl:include href="_index_main.xsl.inc"/>

<atlas:data xmlns:atlas="urn:www.atlasti.com/xml/001">
<atlasDescription version = "2.1"> <!-- Version of this description syntax -->
<version number="2.1"/><!-- version of this stylesheet -->
<friendlyName>Quotations: by Code (no PD no author)</friendlyName> <!-- To be displayed in ATLAS.ti -->
<shortDescription>Show all quotations for each code (with PDs and author)</shortDescription>
<comment></comment>

<category>Report</category>
<subcat>Table</subcat>
<requiredData>
<required>codes</required>
<required>pds</required>
</requiredData>



<complexity>medium</complexity> <!-- Computational complexity -->
<iconPath></iconPath> <!-- To be displayed in ATLAS.ti -->
<author name="hypertexxt.com" email="xml@support.atlasti.com" url="http://forum.atlasti.com/forumdisplay.php?f=13"/>
<creationDate>2010-10-14</creationDate>
<modificationDate>2012-01-19</modificationDate>
<sourceType type = "HU" version = "5.0"/> <!-- XML type acccepted as input -->
<targetDocType>HTML</targetDocType>
</atlasDescription>
</atlas:data>


<xsl:template match="/">


<!-- /////////////////////////////////////////////////////////////////////////-->

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<xsl:call-template name="htmlhead"/>
</head>


<body class="centered">

<xsl:call-template name="pagehead_report"/>

<div id="wrap" class="centered_report">

<h1 class="title"><xsl:value-of select="$description/friendlyName"/></h1>


<div class="tablecontainer">
<xsl:choose>
<xsl:when test="not(msxsl:node-set($uniquelist_codes)//content)">
<p><xsl:value-of select="$outputOption"/></p><!-- warning message -->
</xsl:when>

<xsl:otherwise>
<!-- main busines logic -->

<table border="0" class="printabletable">
<tbody>

<xsl:for-each select="msxsl:node-set($uniquelist_codes)//item[@name!='']">
<xsl:sort select="@name"/>
<xsl:for-each select="quote">

<tr>

<td class="rowstyle{position() mod 2}" align="left">
<h2><xsl:value-of select="@name"/></h2>
</td>

<td class="rowstyle{position() mod 2}" align="left">
<xsl:variable name="outputsize" select="content/@outputsize"/>
<xsl:variable name="hasComment">
<xsl:choose>
<xsl:when test="comment">yes</xsl:when>
<xsl:otherwise>no</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="numberOfParagraphs">
<xsl:value-of select="count(descendant::p)" />
</xsl:variable>
<xsl:copy-of select="content/* "/> <!-- quote name IS contained even if full content is not available -->
<xsl:if test="content/@content='unavailable'">
<xsl:copy-of select="$warnmessage" />
</xsl:if>
</td>

</tr>
</xsl:for-each>
</xsl:for-each>


<!-- <tr>
<td colspan="2" class="white"><br/></td>
</tr>
-->
</tbody>
</table>


</xsl:otherwise>
</xsl:choose>


</div>

</div>

</body>
</html>
</xsl:template>

</xsl:stylesheet>