ExtensionMethod.NET Home of 840 C#, Visual Basic, F# and Javascript extension methods


This one allows you to get nested XML from within a node. Let's say you're parsing an HTML file using the XDocument class and you want to pull out the nested code including tags. This is what you can use!


public static string GetNestedXml(this XElement xe)
    StringBuilder xml = new StringBuilder();

    foreach (XNode node in xe.Nodes())

    return xml.ToString();


p.Text = x.Element("Czech").Element("Text").InnerXml();

Author: Jakub Kottnauer

Submitted on: 1 jun 2010

Language: C#

Type: System.Xml.Linq.XElement

Views: 3334