You've got a bit muddled with your XML syntax - "/>" used in various inappropriate places.
You can do
<xsl:variable name="Sections" select="/root/Sections"/>
<xsl:variable name="SectionCounts" select="/root/SectionCounts"/>
<xsl:for-each select="$Sections/Entity[EntityId = $SectionCounts[Count != 0]/EntityId]">
...
</xsl:for-each>
You asked for an xsl:for-each solution, so I gave you one, but if you had a little more experience you would probably have asked for xsl:apply-templates, to make your code more modular.
You don't need either of the variables here, they are just for readability.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference