Start New Discussion within our Software Development Community

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", "");
This question has already been answered. Start a new discussion instead.