Quick hack.
Assuming path is a string containing a url, change
XDocument xmlDoc = XDocument.Load(path);
to
XDocument xmlDoc = XDocument.Load(path + "?" + Guid.NewGuid().ToString(););
This will win any intermediate caching that will continue, but use ? in the url should not violate the server you are requesting for data.
( Guid.NewGuid() is just a quick way to get a random string. You can easily use the Random or DateTime.Now.Ticks class in the same way if you want.)
source share