GetNestedXml

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

    foreach (XNode node in xe.Nodes())
    {
        xml.Append(node.ToString());
    }

    return xml.ToString();
}
Example:
p.Text = x.Element("Czech").Element("Text").InnerXml();

Description

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!

Details

Double click on the code to select all.

 

;