<p>I've got a Repeater that lists all the <code>web.sitemap</code> child pages on an ASP.NET page.  Its <code>DataSource</code> is a <code>SiteMapNodeCollection</code>.  But, I don't want my registration form page to show up there.</p>

<pre><code>Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes

'remove registration page from collection
For Each n As SiteMapNode In SiteMap.CurrentNode.ChildNodes
If n.Url = "/Registration.aspx" Then
    Children.Remove(n)
End If
Next

RepeaterSubordinatePages.DataSource = Children
</code></pre>

<p>The <code>SiteMapNodeCollection.Remove()</code> method throws a </p>

<blockquote>
  <p>NotSupportedException: "Collection is read-only".</p>
</blockquote>

<p>How can I remove the node from the collection before DataBinding the Repeater?</p>

Using Linq and .Net 3.5:
```
```
//this will now be an enumeration, rather than a read only collection
Dim children = SiteMap.CurrentNode.ChildNodes.Where( _
    Function (x) x.Url <> "/Registration.aspx" )

RepeaterSubordinatePages.DataSource = children
```
```
Without Linq, but using .Net 2:
```
```
Function IsShown( n as SiteMapNode ) as Boolean
    Return n.Url <> "/Registration.aspx"
End Function

...

//get a generic list
Dim children as List(Of SiteMapNode) = _
    New List(Of SiteMapNode) ( SiteMap.CurrentNode.ChildNodes )

//use the generic list's FindAll method
RepeaterSubordinatePages.DataSource = children.FindAll( IsShown )
```
```
Avoid removing items from collections as that's always slow. Unless you're going to be looping through multiple times you're better off filtering.