Is it possible ?? Possible, but tricky. You need to output <tr><td> before data1 tag, and </td></tr> after data2. You could write simply:
<xsl:template match="data1">
<tr><td></xsl:text><xsl:value-of select="."/>
</xsl:template>
<xsl:template match="data2">
<xsl:value-of select="."/></td></tr>
</xsl:template>
but this will violate well-formedness, because tr and td tags are open and not properly closed within container element.

We need to use a trick:
<xsl:text disable-output-escaping="yes"> <td></xsl:text>
Now, from XSLT point of view, <td> is just a text, so there is no well-formedness violation.
The whole stylesheet will be:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="root">
<table>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="data1">
<xsl:text disable-output-escaping="yes"><tr><td></xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="data2">
<xsl:value-of select="."/><xsl:text disable-output-escaping="yes"></td></tr></xsl:text>
</xsl:template>
</xsl:stylesheet>
Doesn't look too elegant to me, though. Maybe there is an easier solution
How to remove type="text/xsl" href="root.xsl" This construction is used if you rely on IE to perform transformation. If you use it to learn XSLT, it's Ok. Otherwise,
you should use XSLT processor on server side, such as Xalan or Saxon.
By the way where did u learned to use node(),text(),i'm using the book XSLT Programmers's reference.
Michal Kay's? it's a very good book, but it's a reference, which means it wasn't designed to
teach XSLT. I used Khun Yee Fung's "XSLT", it is very beginner-friendly. But there are many other now, most of them will work, if they are not references

[ March 12, 2002: Message edited by: Mapraputa Is ]