Similar to my own question about removing commentsmy own question about removing comments you can do this:
// load your Xml string into an XDocument var xml = XDocument.Parse(yourxmlstringhere); foreach (var node in xml.SelectNodes("//orderby").ToList()) { node.ParentNode.RemoveChild(node); } Which will find all orderbyelements, navigate to their parent element and delete them from there.
I adopted this answer from AnthonyAnthony, who pointed out that it will be safer to create a List before removing.