string Filename = "FileName";
System.IO.FileInfo fInfo = new FileInfo(path + "\\" + Filename + ".xml");
if (dirInfo.Exists)
{
if (fInfo1.Exists)
fInfo1.Delete();
}
else
{
dirInfo = new DirectoryInfo(path);
dirInfo.Create();
}
dataSet.WriteXml(path + "\\NewXml.xml", XmlWriteMode.WriteSchema);