Hi all,
I got the following XML C# string:

<Grocery>
            <Food>
                        <Fresh Food>
                                    <fruit>BANANA</fruit>
                                    <meat>CHICKEN</meat>
                                    <desert>CAKE</desert>
                        </Fresh Food>
            </Food>
            <Food>
                        <Fresh Food>
                                    <fruit>APPLE</fruit>
                                    <meat>BEEF</meat>
                                    <desert>PIE</desert>
                        </Fresh Food>
            </Food>
</Grocery>

I want to remove the Fresh Food tags to obtain the following:

<Grocery>
            <Food>
                                    <fruit>BANANA</fruit>
                                    <meat>CHICKEN</meat>
                                    <desert>CAKE</desert>
            </Food>
            <Food>
                                    <fruit>APPLE</fruit>
                                    <meat>BEEF</meat>
                                    <desert>PIE</desert>
            </Food>
</Grocery>

Someone have an idea of how to do this with C# code or XLST in C#?
Thanks

myString.Replace("<Fresh Food>", "");
myString.Replace("</Fresh Food>", "");

Include newline if you want that removed too:

myString.Replace("<Fresh Food>\n", "");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.