Top "Xelement" questions

XElement is part of System.

What is the difference XElement Nodes() vs Elements()?

Documentation says: XContainer.Nodes Method () Returns a collection of the child nodes of this element or document, in document order. …

c# .net xelement
Convert a list of objects to an xml string

Hello I have a list of object i want to convert into an xml. Here is what the final xml …

c# xml xml-serialization xelement
Linq To Xml problems using XElement's method Elements(XName)

I have a problem using Linq To Xml. A simple code. I have this XML: <?xml version="1.0" encoding="utf-8" ?&…

c# linq-to-xml elements xelement
C# - How to remove xmlns from XElement

How can I remove the "xmlns" namespace from a XElement? I tried: attributes.remove, xElement.Name.NameSpace.Remove(0), etc, etc. …

c# xml linq xelement
XAttribute default value if not existing on XElement

Is there an easier/better way to return a default value if a XAttribute on a XElement is not existing?: …

c# .net linq xelement xattribute
How to read large xml file without loading it in memory and using XElement

I want to read a large xml file (100+M). Due to its size, I do not want to load it …

xml xpath linq-to-xml large-files xelement
XElement.Descendants doesn't work with namespace

I have a simple XML, <S xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"><H></…

namespaces xelement
How to Cast to Generic Parameter in C#?

I'm trying to write a generic method for fetching an XElement value in a strongly-typed fashion. Here's what I have: …

c# generics casting linq-to-xml xelement
How to add value between tags using XElement?

I have looked a bunch of XML samples using XDocument and XElement but they all seem to have self closing …

c# xml linq-to-xml xelement
Querying xml child elements with prefixed namespace using LINQ to XML

So I have some XML that generally looks like this <wd:Data xmlns:wd="urn:com.foo.bar/GetResult"&…

c# linq linq-to-xml xelement