Top "Linq-to-xml" questions

LINQ-to-XML provides a SQL-like query experience for navigating, parsing, and aggregating data stored in XML documents.

How can I parse this XML (without getting "Root element is missing" or "Sequence contains no elements")?

This is an offshoot from this question Why is the HttpWebRequest body val null after "crossing the Rubicon"? which was …

c# linq-to-xml frombodyattribute
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
C# Linq to XML check if element exists

I have an XML document as follows: <Database> <SMS> <Number>"+447528349828"</Number> <…

c# xml linq linq-to-xml
How do I use XPath with a default namespace with no prefix?

What is the XPath (in C# API to XDocument.XPathSelectElements(xpath, nsman) if it matters) to query all MyNodes from …

c# xpath linq-to-xml xml-namespaces
Regex in Linq statement?

I'm writing a short C# to parse a given XML file. But 1 of the tag values can change, but always …

c# regex linq linq-to-xml
Loop through multiple subnodes in XML

<Sections> <Classes> <Class>VI</Class> <Class>VII</Class> &…

c# xml linq-to-xml xmlnode xmlnodelist
How to remove an element from an xml using Xdocument when we have multiple elements with same name but different attributes

I have an xml document which looks like this: <Applications> <myApp> <add key="ErrorDestinationEventLog" value="…

c# xml linq linq-to-xml
Use XDocument as the source for XmlSerializer.Deserialize?

I would like to invoke XmlSerializer.Deserialize passing it an XDocument. It can take a Stream, an XmlReader or a …

.net linq-to-xml
how to Check if a XML child element exists with Linq to XML

How can I check if IncomingConfig element exists by use linq to xml? <?xml version="1.0" encoding="utf-8"?> <…

c# xml linq-to-xml
XDocument.Descendants not returning descendants

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.…

c# .net xml linq-to-xml