What is the simplest approach to creating an XML document from a multiples tables from a database ie: Orders > OrderItems < Products …. may be :
<Order id="1">
<OrderItem id ="1">
<Product>Wheel</Product>
<Qty>1<Qty/>
<Price>10.00</Price>
</OrderItem>
<Order>
I need it in XML to transform to XHTML for loading into Word.
I am also using MVC3, EF5.
Thanks
You didn’t give a ton of detail, but you could use the XmlSerializer class. You could string writer if you’re only wanting to output to a string instead.
A code sample from MSDN: