<pre><code>&lt;xsl:for-each select="./node [position() &amp;lt;= (count(*) div 2)]"&gt;
    &lt;li&gt;foo&lt;/li&gt;
&lt;/xsl:for-each&gt;
&lt;xsl:for-each select="./node [count(*) div 2 &amp;lt; position()]"&gt;
    &lt;li&gt;bar&lt;/li&gt;
&lt;/xsl:for-each&gt;
</code></pre>

<p>My list has 12 nodes, but the second list is always 8 and the first is always 4. What's wrong with my selects?</p>

I'm not at all sure, but it seems to me that
```
count(*)
```
is not doing what you think it is.  That counts the number of children of the current node, not the size of the current node list.  Could you print it out to check that it's 8 or 9 instead of 12?
Use
```
last()
```
to get the context size.