static XDocument LoadXml(string fileName)
{
XDocument xml;
if(!File.Exists(fileName))
throw new ArgumentException(String.Format("File '{0}' not found", fileName), "fileName");
xml = XDocument.Load(fileName);
if(xml == null)
throw new ArgumentException(String.Format("Unable to load XML from '{0}'", fileName), "fileName");
return xml;
}