Compare items in two lists
So let me get this straight, you are trying to determine if list A is a subset of list B?

internal bool DoIdsMatchThoseFromXml(List&lt;string&gt; ids, List&lt;string&gt; xmlIds)
{
    return !ids.Except(xmlIds).Any(); // A - B = {}
}


Or are you trying to see if list A is set equal to list B?

internal bool DoIdsMatchThoseFromXml(List&lt;string&gt; ids, List&lt;string&gt; xmlIds)
{
    return ids.Count == xmlIds.Count // assumes unique values in each list
        &amp;&amp; new HashSet&lt;string&gt;(ids).SetEquals(xmlIds);
}


I would avoid performing linear searches through this as you'd be looking at O(n*m) performance when you could be doing O(n+m).  Use set operations if you can.  Use HashSet&lt;string&gt; if possible too.