<p>I want something like this:</p>

<pre><code>&lt;msxsl:script language="C#"&gt;
   ??? getNodes() { ... return ... }
&lt;/msxsl:script&gt;

&lt;xsl:for-each select="user:getNodes()"&gt;
    ...
&lt;/xsl:for-each&gt;
</code></pre>

<p>What return type should i use for <code>getNodes()</code> and what should i put in it's body?</p>

A quick google for C# xslt msxml revealed a link to the following page which gives many examples of extending XSLT in microsoft environments.
http://msdn.microsoft.com/en-us/magazine/cc302079.aspx
Specifically the section on Mapping Types between XSLT and .Net gives you exactly the information you need:
W3C XPath Type -  Equivalent .NET Class (Type)
String - System.String
Boolean - System.Boolean
Number - System.Double
Result Tree Fragment - System.Xml.XPath.XPathNavigator
Node Set - System.Xml.XPath.XPathNodeIterator
So in your example I would try XPathNodeLiterator.