How to get a multilookup value in code

I’m doing some development lately (instead of the normal no-code-solutions). This piece of code you can use to get the value of a multilookup field:

Dim query As String = "<Where><Eq><FieldRef Name=""ID"" /><Value Type=""Counter"">" & id & "</Value></Eq></Where>"
        For Each listitem As SPListItem In Me.GetSPListItem(query) ‘code to get the items … no magic here …
            If Not listitem.Fields(fieldname) Is Nothing Then
                Dim studentValues As SPFieldLookupValueCollection = listitem(fieldname)
                If Not studentValues Is Nothing Then
                    For Each studentValue As SPFieldLookupValue In studentValues
                        ‘do something with each value
                        ‘it contains the ID and Title
                    Next
                End If
            End If
        Next