xml file using vb.net

I would like to remove the folowing items form the attached xml file programmatically using vb.net. Any help here would be greatly appreciated.

<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<field name="Send"/>
<ids original="C0D4AFCC3BAC5AC8060BBF8AD9CA33F9" modified="73A35486E49D844DAAD9BB91815D72E2"/>
<f href="http://www.eriskservices.com/Forms/BAMApp0408Test.pdf"/>

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Meir RivkinFull stack Software EngineerCommented:
here's the code and output xml attached:
Dim xml As String = "c:\temp\14-26-2010-3-16-06-PM.xml"
Dim root As XElement = XElement.Load(xml)
Dim fields As XElement = root.Elements().First()
Dim xe As XElement = fields.Elements().Where(Function(n) n.Attribute("name").Value = "Send").FirstOrDefault()

Open in new window

Meir RivkinFull stack Software EngineerCommented:

the code i've posted is applied to .net 3.5, if u use earlier .net versions let me know and i'll post you a new snippet.

PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

E-RiskAuthor Commented:
Yes I am actually using .net 2. How does this differ? Thanks.
Meir RivkinFull stack Software EngineerCommented:
here's it in .net 2.0:
Dim xml As String = "c:\temp\4-26-2010-3-16-06-PM.xml"
        Dim xdoc As New XmlDocument()

        Dim node As XmlNode = xdoc.DocumentElement.ChildNodes(0)
        Dim xnode As XmlNode = node.CloneNode(True)
        Dim root As XmlElement = xdoc.DocumentElement
        For Each item As XmlNode In root.ChildNodes
            If item.Attributes("name").Value = "Send" Then
                Exit For
            End If

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Meir RivkinFull stack Software EngineerCommented:
u need to add: Imports System.Xml
E-RiskAuthor Commented:
Awesome!! I wish I could give 1000 points. Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.