My XML:
<content>
<item id="1">A</item>
<item id="2">B</item>
<item id="4">D</item>
</content>
I have loaded this using XML similar to:
XDocument xDoc = new XDocument(data.Value);
var items = from i in xDoc.Element("content").Elements("item")
select i;
I want to insert another element, to end up with something like:
<content>
<item id="1">A</item>
<item id="2">B</item>
<item id="3">C</item>
<item id="4">D</item>
</content>
How do I do this using Linq2Xml?
Thanks,
Matt.