Instead, Where(x => x.NodeType == XmlNodeType.Comment)I would just use OfType<XComment>(), as in
doc.DescendantNodes().OfType<XComment>().Remove();
but both approaches should remove comment nodes at all levels.
Here is an example:
XDocument doc = XDocument.Load("../../XMLFile1.xml");
doc.Save(Console.Out);
Console.WriteLine();
doc.DescendantNodes().OfType<XComment>().Remove();
doc.Save(Console.Out);
For the sample, I get the output
<?xml version="1.0" encoding="ibm850"?>
<root>
<foo>
<bar>foobar</bar>
</foo>
</root>
<?xml version="1.0" encoding="ibm850"?>
<root>
<foo>
<bar>foobar</bar>
</foo>
</root>
therefore all comments are deleted. If you still have problems, send samples that will allow us to reproduce the problem.