Visual Studio 2010, Silverlight 4, and C#. I have the following data stored in an XML file:
<root>
<element>TextHere</element>
<element>TextHere</element>
<element>TextHere</element>
</root>
This is my current code.
XDocument xmlDoc = XDocument.Load("XMLDocument.xml");
var ElementsList = from Elements in xmlDoc.Descendants("root")
select new
{
ElementContent = Elements.Element("Element").Value,
};
This code only puts the very first element in the list, leaving all of the others out. How can I rewrite this code so that it will capture ALL of the elements that are named "element" in the XML file?