Well if your xml is
Code:
<gxl>
<graph>
<node id="0">
<attr name="label">
<string>label0</string>
</attr>
<attr name="font">
<string>font</string>
</attr>
</node>
<node id="1">
<attr name="label">
<string>label1</string>
</attr>
<attr name="font">
<string>font</string>
</attr>
</node>
<node id="2">
<attr name="font">
<string>font</string>
</attr>
</node>
<node id="3">
<attr name="label">
<string>label3</string>
</attr>
<attr name="font">
<string>font</string>
</attr>
</node>
</graph>
</gxl>
then you want something along the lines of
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<states>
<xsl:apply-templates select="gxl/graph/node"/>
</states>
</xsl:template>
<xsl:template match="node">
<state>
<name><xsl:value-of select="@id"/></name>
<xsl:if test="attr[@name = 'label']">
<condition><xsl:value-of select="attr[@name = 'label']/string"/></condition>
</xsl:if>
</state>
</xsl:template>
</xsl:stylesheet>
which selects all the node eleemnts and adds the surrounding markup. There is also a conditional test for an attr with a attribute name of label.
Joe (MVP - xml)