C# Linq to XML – Keeping namespaces in parent nodes while removing them from child nodes So I have this XML tree created through LINQ to XML, like this: