Ok matey, what you need to do is put this as the else statement for the if (node.NodeType==XmlNodeType.Element) statement:
else if (reader.NodeType == XmlNodeType.EndElement)
{
//Closing feed tag - add the subscription at this point
if (reader.Name=="feed")
{
// if successfull, give it the go to add into each feed into our subscription structure.
TheCurrentSubscriptions.Add(subscription);
//Create a new subscription so we don't get any previous data mixed with the new record
subscription = new Subscription();
}
}
And get rid of the existing TheCurrentSubscriptions.Add(subscription); line from the loop.
Other comments:
You'll need to move the reader.Close() method call to after the while loop - it won't always be called at the moment.
You don't really need the break statement at line 131 (after the current reader.Close()) because what this will do is cause your code to quit early if you encounter an unexpected node. What I'd do is put a default case on the switch statement and call System.Diagnostics.Debug.Fail
to let me know something unusual has happened.
Hope that helps...