Top "Xelement" questions

XElement is part of System.

How to get specific element Count in XML or XElement variable

Consider this XML: <Employees> <Person> <ID>1000</ID> <Name>Nima</…

c# xml linq xelement
How to convert from string to XElement object

I have a string like this: "<Root><Child>Hey</Child></Root>" How …

c# xml xelement
XML parsing using XElement

Can't seem to find how to appropriately parse this using XElement: <messages> <message subclass="a" context="d" …

c# xml xelement
XDocument to XElement

How do you convert an XDocument to an XElement? I found the following by searching, but it's for converting between …

c# xml linq-to-xml xelement
Remove empty/blanks elements in collection of XML nodes

I have an XML document like this: <magento_api> <data_item> <code>400</code&…

c# linq-to-xml xelement
Convert single XElement to object

I have a single XElement looking like this: <row flag="1" sect="" header="" body="" extrainfo="0" /> Then I have a …

c# .net xml linq-to-xml xelement
XElement to get all sub-element node names and values

I'm thinking of an approach something like this. Please let me know if this can actually work this way: For …

c# xmldocument xelement selectnodes
Workaround for "undeclared prefix" error on XElement.Load()

I'm pulling the source of a website. I then want to extract a specific part of it. My intention is …

xml xelement
Remove attributes from XElement

I am trying to remove some attributes from xml document. Here is what I tried: private void RemoveEmptyNamespace(XElement element) { …

c# xelement
How to convert XElement to XDocument

How can I convert XElement into XDocument? Is there some built-in method for this? The only way I can think …

c# xml linq-to-xml xelement