Private Shared Sub RemoveXmlNode()
Dim xmlPath As String = "C:\Arun\Projects\ConsoleTest\ConsoleTest\Response.xml"
Dim dataSet As New DataSet()
dataSet.ReadXml(xmlPath)
dataSet.AcceptChanges()
' <value opctag="TEST.Goood" />
For i As Integer = 0 To dataSet.Tables("value").Rows.Count - 1
If dataSet.Tables("value").Rows(i)("opctag").Equals("Test.Gooood") Then
dataSet.Tables("value").Rows(i).Delete()
dataSet.Tables("value").Rows(i).AcceptChanges()
End If
Next
dataSet.WriteXml(xmlPath, XmlWriteMode.IgnoreSchema)
End Sub
|