protected override void SaveChanges() { XmlStream.Position = 0; XmlStream.SetLength(0); base.SaveChanges(); XmlStream.Flush(); }