CSharp examples for System.Xml:XML Element
Get XML Elements Any Namespace
using System.Xml.Linq; using System.Linq; using System.Collections.Generic; public class Main{ public static IEnumerable<XElement> ElementsAnyNS<T>(this IEnumerable<T> source, string localName) where T : XContainer {//from w w w . j a va2s.c o m return source.Elements().Where(e => e.Name.LocalName == localName); } }