CSharp examples for System.Xml:XML Element
Find Children XmlElement
using System.Xml; using System.Collections.Generic; using System.Collections; using System;/*from w w w . java 2 s .c o m*/ public class Main{ public static List<XmlElement> FindChildren(XmlElement parent, string childNodeName){ List<XmlElement> ret = new List<XmlElement> (); foreach (XmlNode node in parent.ChildNodes) { if (node.NodeType == XmlNodeType.Element && node.Name == childNodeName) { ret.Add( (XmlElement)node ); } } return ret; // Return whatever we found. } }