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:0
I just going to create an extension method InnerXml to return me the innerXML
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);
}
Source: stackoverflow.com
Related Query
- How can I get an XML fragment as a string from an XElement?
- How can i get a string from linq expression?
- How can I get a List<int> from LINQ to XML that produces List<List<int>>?
- how i can get a <w:pict> tag from word document using open xml
- How can i get all subnode values separately from XML Response using LINQ to XML?
- How can I get a list of text from an xml document using c#?
- How can I get every nth item from a List<T>?
- How to Get XML Node from XDocument
- How to get specific element Count in XML or XElement variable
- using LINQ how can i concatenate string properties from itesm in a collection
- How do I get the value from a specific node in an XML file?
- How to get all values as a single string from NameValueCollection?
- How to get XML Elements from XmlDocument object?
- How do i get all "properties" from xml via linq to xml
- How to get unique string from a lambda expression
- How can I get back from an un-typed Expression to a typed one?
- How do I get an array of repeated characters from a string using LINQ?
- How can I build a string from a collection with Linq?
- How can I get running totals of integer values from a List()?
- How to get strongly-typed collection from XML using Linq
- How can I get data from a list with a where clause to another list?
- How can I sort my string array from .GetFiles() in order of date last modified in asp.net-webpages?
- how to get value from xml by Linq
- How to get <? tags from xml with vb.net
- How can I user LINQ to get a IList<string> from a multi-table join?
- How can we get an autogenerated Id from the Table While Inserting?
- How can I use Linq to build a c# object from xml where an element has zero or more elements of the same type?
- how to get string from string list?
- C# LINQ How to get a data source from a db?
- How can I get the top three players and their high scores from a collection using linq and lambdas
More Query from same tag
- EF Query: Give .Contains() a combination of two elements to act upon when getting the information from a Database
- linq determine if the field names in list<string> are found in selection of fields from list<Class>
- Subset Sum for Complex Type
- How to convert PropertyInfo to property expression and use it to invoke generic method?
- Force linq sum to return null
- Get multiple fields based on ids in a string using LINQ
- Item in a list of a list of a list is not being displayed in the console
- Why are some object properties UnaryExpression and others MemberExpression?
- App_Data folder shadow folder empty
- The cast to value type 'System.Single' failed in c# linq
- Most efficient way to flatten a nested Dictionary?
- how to add multiple conditions in this lambda function?
- Checking two IEnumerables for equality
- C# - How to Filter a List for condition A, then for these matched only, Filter by Condition B, without breaking the List Order
- Select on empty list's group item gives non-empty list
- What is the correct syntax for using an expression in a Linq query?
- Instantiate a class in MVC 5 gives error [class] does not contain a definition for [member] and no extension method [member] ... could be found
- Converting SQL query to LINQ query
- How to optimize a LINQ Where condition with Any(x => DbFunctions.Like())
- How to get the index of each item that is null in a List<T> via Linq
- getting Maximum Absolute Value and its other related value
- Problem with Json
- How to find the second latest file in folder
- Why isn't .Except (LINQ) comparing things properly? (using IEquatable)
- LINQ-like or SQL-like DSL for end-users to run queries to select (not modify) data?
- Linq query for below data
- query a view with a list of data
- select matching object twice in a linq where-in clause
- Compare XML Node Values using Name Tag and Remove the Tag
- How to call method/function in where clause of a LINQ query as IEnumerable object