The XML file is still a file; just use File.Exists .
Just a cautionary note: Do not try to check File.Exists just before loading the document. There is no guarantee that the file will still be present when you try to open it. Writing this code:
if (File.Exists(fileName)) { XDocument doc = XDocument.Load(fileName);
... is a condition of race and always erroneous. Instead, just try loading the document and catch the exception.
try { XDocument doc = XDocument.Load(fileName);
source share