XElement - Getting OuterXML and InnerXML
public static class MyExtensionClasses
{
public static string OuterXml(this XElement thiz)
{
var xReader = thiz.CreateReader();
xReader.MoveToContent();
return xReader.ReadOuterXml();
}
public static string InnerXml(this XElement thiz)
{
var xReader = thiz.CreateReader();
xReader.MoveToContent();
return xReader.ReadInnerXml();
}
}