Linq to XML 'Where not in' syntax problem <p>The following Code does not compile</p> <pre><code>Dim BasicGroups As String() = New String() {"Node1", "Node2"} Dim NodesToRemove = From Element In SchemaDoc.Root.&lt;Group&gt; _ Where Element.@Name not in BasicGroups For Each XNode In NodesToRemove XNode.Remove() Next </code></pre> <p>It is supposed to Remove any Immediate child of the rootnode which has an attribute called name whose value is <strong>Not</strong> listed in the BasicGroups StringArray.</p> <p><strong>What is the correct syntax for this task?</strong></p>