Approved answer will always add children to the end of document. If you need to remove entry in the middle of the document and keep children where they sit, do following:
x.AddAfterSelf(x.Nodes());
x.Remove();
Following code removes all
nodes keeping children in the correct place:
while (doc.Descendants("x").Count() > 0)
{
var x = doc.Descendants("x").First();
x.AddAfterSelf(x.Nodes());
x.Remove();
}