CSharp examples for System.Xml:XML Element
Get First XML Element
using System.Xml.Serialization; using System.IO;/*from w ww .j a v a2 s . com*/ using System.Xml; using System.Text.RegularExpressions; using System; public class Main{ public static XmlElement GetFirstElement(XmlDocument doc, string name) { XmlNodeList list = doc.GetElementsByTagName(name); if (list == null) { return null; } return (XmlElement) list.Item(0); } }