It depends on what you want to output. Can you show us the output you want to generate with your stylesheet?
You could for instance use
Code:
<xsl:for-each select="/painters/artist[*[node()]]">
to ensure your for-each processes only those artist elements that have a non-empty child element.
--
Martin Honnen
Microsoft MVP - XML