System.XML namespace of .NET framework, play a major role for your problem. Herez the sample code:
static void Main(string[] args)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml("<root><node /><node /><node /></root>");
XmlNodeList xmlNodeList = xmldoc.SelectNodes("//node");
XmlNode[] array = (
new System.Collections.Generic.List<XmlNode>(
Migrate<XmlNode>(xmlNodeList))).ToArray();
}
public static IEnumerable<T> Migrate<T>(System.Collections.IEnumerable enumerable)
{
foreach (object current in enumerable)
{
yield return (T)current;
}
}