CSharp examples for System.Xml:XML Element
Child Element Count
using System.Xml; using System.Text; using System.Linq; using System.Collections.Generic; using System;//from w w w. j a v a2 s . co m public class Main{ public static int ChildElementCount(this XmlElement element) { int count = 0; foreach (XmlNode child in element.ChildNodes) { if (child is XmlElement) count++; } return count; } }