This can be easily done using template matches instead of using for-each but looks like the iframe is not rendering because YouTube uses a different URL for embedding/iframes
http://www.youtube.com/v/2H2XDQqvbpc
instead of
https://www.youtube.com/watch?v=2H2XDQqvbpc
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="imagefolder" select="'xml/images/'" />
<xsl:template match="/">
<html>
<body>
<table border="1px" bordercolor="#FFFFFF" width="100%">
<tr bgcolor="#cccccc">
<th style="text-align:left">Title</th>
<th style="text-align:left">Year</th>
<th style="text-align:left">Label</th>
<th style="text-align:left">Tracks</th>
<th style="text-align:left">Artwork</th>
</tr>
<xsl:for-each select="dalehoward/ep">
<xsl:sort select="year" order="ascending" data-type="number"/>
<xsl:if test="@id = 1">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="label"/></td>
<td><xsl:for-each select="track">
<xsl:if test="../@id = 1">
<xsl:value-of select="@number"/>.
<xsl:value-of select="tname"/><br />
<xsl:value-of select="length"/> <br /><br />
<xsl:variable name="vid">
<xsl:analyze-string select="ytubelink" regex="(((https://)?)((http://)?)(www\.)?((youtube\.com/)|(youtu\.be)|(youtube))(.+=)(.+))">
<xsl:matching-substring>http://www.youtube.com/v/<xsl:value-of select="regex-group(12)"/></xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:copy-of select="."/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:variable>
<xsl:element name="iframe">
<xsl:attribute name="class">cf</xsl:attribute>
<xsl:attribute name="width">440</xsl:attribute>
<xsl:attribute name="height">260</xsl:attribute>
<xsl:attribute name="src"><xsl:value-of select="$vid"/></xsl:attribute>
<xsl:attribute name="frameborder">0</xsl:attribute>
<xsl:comment/>
</xsl:element> <br /><br />
</xsl:if>
</xsl:for-each></td>
<td><img width="150px" height="150px"><xsl:attribute name="src">
<xsl:copy-of select="$imagefolder"/>
<xsl:value-of select="image"/>
</xsl:attribute></img></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>