I have a XML file like this:
<?xml version='1.0' encoding='utf-8'?>
<sitegroup name = 'healthcare'>
<site name='A' url='a.aspx'/>
<site name='B' url='b.aspx'/>
</sitegroup>
<sitegroup name = 'diet'>
<site name='C' url='c.aspx'/>
<site name='D' url='d.aspx'/>
</sitegroup>
I am new to C#. I need a simple code to insert a new [site] (entered by user) under a particular [sitegroup] (also choosen by user). if the [sitegroup] supplied by user does not exist in the XML already, the code should create a new [sitegroup] at the end of the XML and then insert the new [site] in it.
Also, could you please let me know how to delete a particular [site] or/and a whole [sitegroup] from the XML?
Thanks a lot in advance.