Prova con qualcosa di simile: fai attenzione in particolare all' ultimo if!
Codice PHP:
string currentChannelLink,currentChannelTitle;
while (reader.Read())
{
XmlNodeType type = reader.NodeType;
if (type == XmlNodeType.Element && reader.LocalName == "channel")
{
currentChannelLink = "";
currentChannelTitle = "";
}
if (type == XmlNodeType.Element && reader.LocalName == "title")
{
currentChannelTitle = reader.ReadInnerXml();
}
if (type == XmlNodeType.Element && reader.LocalName == "link")
{
currentChannelLink = reader.ReadInnerXml();
}
if (type == XmlNodeType.EndElement && reader.LocalName == "channel")
{
//a questo punto hai il title e il link del channel
//e componi l'output
}
}