CSharp examples for System.Xml:XML Attribute
Get XML Node By Name Attribute
using System.Xml.Linq; using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from ww w . j a va 2 s .c o m*/ public class Main{ public static XElement GetNodeByNameAttribute(XElement item, string NodeName, string AttrName, string AttrValue) { var res = (from e in item.Elements(NodeName) where e.Attribute(AttrName).Value == AttrValue select e).SingleOrDefault(); return res; } }