A: 

Try:

XmlDocument doc = new XmlDocument();
doc.Load(url);
doc.Save(filename);

It really is that easy (with some error handling obviously). The .Net framework should do everything for you. I jumped through hoops a month or so ago trying to do the same thing and kicked myself when I read the help file on XmlDocument ;)

Russell Troywest
**facepalm** You are a genius. Works like a bloody charm. Thanks a bundle. Thanks a lot
gzzzur
No Worries. Glad to save someone some time. The WebClient.DownloadFile is one I'll remember as well if I don't need to validate the XML at all.
Russell Troywest
A: 

It could be as simple as not calling Flush() on your StreamWriter, but why make life hard for yourself? Replace the whole writeXMLtoFile function with this:

public static void writeXMLtoFile()
{
    string url = "http://somevalidurl.com/dataPage.php?lotsofpars=true";
    string xml = ScreenScrape(url);
    File.WriteAllText("xml\\myFile.xml", xml);
}

This way, you can also use the debugger to see what's going on (inspect the xml variable).

Jon Grant
Thanks for taking the time to reply :)
gzzzur
+1  A: 

Additionally, if really all you want to do is download a page to the file system, investigate the WebClient.DownloadFile method :)

Jon Grant