First you need to change your mindset. You don't create start tags and end tags in XSLT - you create nodes structured as a tree. (In fact you seem to be using the word "tag" interchangeably (a) in its correct sense where[list] and </ul> are two separate tags, a start tag and an end tag, and (b) incorrectly as a synonym for "element".)
In your particular example the solution is actually quite straightforward:
<xsl:template match="td">
<li><xsl:copy-of select="a[1]"/></li>
[list]<li><xsl:copy-of select="a[position() > 1]"/></li></ul>
</xsl:template>
Some similar problems are much more difficult, especially in XSLT 1.0: search for "XSLT positional grouping" for details.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference