Last post Oct 28, 2010 02:20 AM by Wencui Qian - MSFT
Oct 25, 2010 05:40 AM|misuk11|LINK
I have some xml read into a XDocument object from a database. I need to determine the instances within the xml of specific nodes. For each instance of the chosen node, I need to insert another node directly beneath it. Heres what Ive got so far to obtain
a list of specified nodes
how would I go about this ? anyone got any pointers ?
Oct 27, 2010 11:08 AM|Huske|LINK
When you start iterating through you list using foreach, an object should be a type of XElement, in which case you can use Add method to add new child element or attribute.
Hope this help
Oct 28, 2010 02:20 AM|Wencui Qian - MSFT|LINK
As suggested above, you can use Add method to add content to the element. For more samples of LINQ to XML, I recommand to check out this link: