LinkedList<T> (2.0): removing items iteratively
<p>I need to iterate through a <code>LinkedList&lt;T&gt;</code> (in .NET 2.0) and remove all the items according to a given criteria.
It was easy way under Java, since I could do the following:</p>

<pre><code>Iterator&lt;E&gt; i = list.iterator();
while (i.hasNext()) {
    E e = i.next();
    if (e == x) {
        // Found, so move it to the front,
        i.remove();
        list.addFirst(x);
        // Return it
        return x;
    }
}
</code></pre>

<p>Unfortunately, in the .NET behavior of <code>IEnumerator&lt;T&gt;</code> (the equivalent of <code>Iterator&lt;E&gt;</code>) there's no <code>remove</code> method to remove the current element from the collection.
Also, in the <code>LinkedList&lt;T&gt;</code> there's no way to access an element at a given index, to accomplish the task by iterating back from the last to the first.</p>

<p>Have you got any idea on how to do it? Thank you very much!</p>
