CSharp examples for System.Xml:XML Node
Get First Child from XmlNode
using System.Xml; using System.Text; using System.Collections.Generic; using System;/* ww w . j a v a2 s . c om*/ public class Main{ public static XmlElement GetFirstChild(XmlNode node, string tagName) { foreach (XmlNode child in node.ChildNodes) { if (child.NodeType == XmlNodeType.Element && tagName.Equals(child.LocalName, StringComparison.OrdinalIgnoreCase)) return (XmlElement)child; } return null; } }