如何在程序中指定一个xml文件,然后对它进行添加,插入,删除一个元素的动作?如下所示:
<title>
    <group text="haha">
       <item text="hahaa" nodedata="jsdfhgkj"/>
       <item text="hhh" nodedata="jjjjj"/>       
    </group>
</title>
想要在执行添加动作之后得到以下结果,要怎么写?删除和插入有分别要怎么写呢?先行谢过呢!
<title>
    <group text="haha">
       <item text="hahaa" nodedata="jsdfhgkj"/>
       <item text="hhh" nodedata="jjjjj"/>       
       <item text="fff" nodedata="llll"/>       
    </group>
</title>
16:49 2005-3-16

如何在程序中指定一个xml文件,然后对它进行添加,插入,删除一个元素的动作?如下所示:
<title>
    <group text="haha">
       <item text="hahaa" nodedata="jsdfhgkj"/>
       <item text="hhh" nodedata="jjjjj"/>       
    </group>
</title>
想要在执行添加动作之后得到以下结果,要怎么写?删除和插入有分别要怎么写呢?
<title>
    <group text="haha">
       <item text="hahaa" nodedata="jsdfhgkj"/>
       <item text="hhh" nodedata="jjjjj"/>       
       <item text="fff" nodedata="llll"/>       
    </group>
</title>

以上述xml文件为例,想要在xxx.xml文件中增加一个记录,这样写为什么不能增加?望高手指点一二!谢过!
        Dim xmlWriter As XmlTextWriter = New XmlTextWriter("xxx.xml", Nothing)
        xmlWriter.WriteStartElement("group")
        xmlWriter.WriteStartAttribute("text", "google")
        xmlWriter.WriteStartAttribute("nodedata", "google")
        xmlWriter.WriteEndAttribute()
        xmlWriter.WriteEndElement()
        xmlWriter.Flush()
        xmlWriter.Close()