score:2
Eric White just posted a blog article to do exactly that - convert XElement to XmlNode and back.
Check it out here.
Marc
score:1
Try something like this:
var x = elem.Descendants();
This will return you all the descendants of the root node - if you want a specific one you can pass its name as a string parameter to this same method.
Edit: If you really need it as a string you can aggregate the nodes. Here is an extension method that will do the trick:
public static String InnerXml(this XElement source)
{
return source.Descendants().Select(x => x.ToString()).Aggregate(String.Concat);
}
score:0
I just going to create an extension method InnerXml to return me the innerXML
Source: stackoverflow.com
Related Articles
- The given value of type String from the data source cannot be converted to type int of the specified target column
- creating Linq to sqlite dbml from DbLinq source code
- How can I get an XML fragment as a string from an XElement?
- List or Array of String Contain specific word in Html Source Code
- c# Linq or code to extract groups from a single list of source data
- ASP.NET Add cell to Gridview row with string from code behind
- Retrieving string from XML XElement variable
- C# - code to order by a property using the property name as a string
- Construct LambdaExpression for nested property from string
- Remove all empty elements from string array
- Convert XElement to string
- Linq filter List<string> where it contains a string value from another List<string>
- Conversion from Int array to string array
- Entity Framework/Linq EXpression converting from string to int
- Make CSV from list of string in LINQ
- Using LINQ to parse the numbers from a string
- Read text content from XElement
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Accessing Results View from variable in code
- Generating the Shortest Regex Dynamically from a source List of Strings
- How to remove characters from a string using LINQ
- C# - How to remove xmlns from XElement
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- Get an acronym from a string in C# using LINQ?
- LINQ to Entities - How to return a single string value from entity
- Creating a property selector Expression from a string
- How to create hierarchy in json string from string array?
- using LINQ how can i concatenate string properties from itesm in a collection
- LINQ C# Selecting characters from string
- Extract data from a XML string using linq vs xmlDocument
- Linq syntax to state explicit type instead of var
- How do I change this sql query to linq to sql?
- Adding a sort column into list C#
- C# Linq from DataTable
- Using Linq to select multiple items per iteration?
- Why IEnumerable.ToList() return fields in alphabetical order?
- Inputs a sentence from user, determines and displays nonduplicate words in alphabetical order
- LINQ Left Outer JOIN Syntax Difference
- Is it possible to create C# language modifications as did LINQ?
- Public Active directory for testing
- Is there a way I could combine these two LINQ statements?
- Manually removing items from a collection vs using Enumerable.Except C#
- C# LINQ converting a query to dictionary
- Fastest way to query data by a specific date and data by next older date from oracle table?
- linq version of a query with let operator
- Linq query for EF 4.1 data with nested lists bound to WPF form
- Updating one Generic List<T> with Another Via Linq c#
- Entity Framework order by string in over 10 million rows
- Query is very slow in ASP.net and Profiler, but fast in SQL Management Studio 2014
- C# linq how to get all the first elements of a nested dynamic list?