Better way to group elements?
Since ListItemCollection implements IEnumerable, but not IEnumerable&lt;ListItem&gt;, you have to use Cast before you can use other LINQ methods.

After you do that, you can use GroupBy, as Steve Michael suggested and then work with the result almost exactly like with your groups:

var categoryGroups = this.Items.Cast&lt;ListItem&gt;()
    .GroupBy(i =&gt; i.Attributes["category"]);

foreach (var categoryGroup in categoryGroups)
{
    RenderOptionGroupBeginTag(group.Key, writer);

    foreach (var item in group)
    {
        this.RenderListItem(item, writer);
    }

    RenderOptionGroupEndTag(writer);
}


Some other changes I made to the code:


I used foreach instead of ForEach(). ForEach() looks like a LINQ method, but it behaves very differently, since it doesn't do any querying. I think that in cases like this, foreach in the most suitable option.
Changing groups (and group) to categoryGroups means that the code is clearer and so you can get rid of the loop comment.
I also removed the other comments, because I think the code is clear about what it does. If you want to emphasize that RenderOptionGroupBeginTag creates &lt;optgroup&gt;, maybe you should rename it? Probably to something like RenderOptgroupBeginTag.