memory stream kullanmana gerek yok o halde, sadece

var xmlDoc = XDocument.Load(@"c:\dosya.xml");

seklinde degistirmen yeterli