troubleshooting Question

C# Linq to Get XML

Avatar of CipherIS
CipherISFlag for United States of America asked on
C#LINQ Query.NET Programming
38 Comments5 Solutions400 ViewsLast Modified:
If I have the below XML.  I want to do 2 things.

First get everything between <key></key> so I can fill up my models in my .NET code.  
Second Delete Key id 123 and everything between

How can I accomplish that with LINQ?

<Reports>
    <personnel></personnel>
    <events>
        <key id="123">
            <Model1>
                <Test1>1</Test1>
                <Test1>2</Test1>
                <Test1>3</Test1>
            </Model1>
            <Object>
                <ABC>
                    <Test1>1</Test1>
                    <Test1>2</Test1>
                    <Test1>3</Test1>
                </ABC>
                <ABC>
                    <Test1>4</Test1>
                    <Test1>5</Test1>
                    <Test1>6</Test1>
                </ABC>
            <Object>
        </key>
    </events>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 5 Answers and 38 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 5 Answers and 38 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros