I am trying to create a xml document using Xelement. I have a List of 2 objects, Data and Products. each has a list of objects. the xml document needs to be setup like this
<Property>
<Points>
<Sqft>1432</Sqft>
<Price>45666</Price>
<Product>Product Name</Product>
</Points>
</Property>
Here is the code that I am using, of course it doesn't work but it is what I would theoretically need it to do.
var xEleProperty = new XElement("Property",
from item in Property.Data && item1 in Property.Products
select new XElement("points",
new XElement("Sqft", item.sqft),
new XElement("Price", item.price),
new XElement("Product", item1.product)
));