title: Application settings fom custom XML file, loading and error-handling
body: <p>I'm working on a legacy application that uses a static class to store settings that are read from a custom XML file.
  However, as part of a slight upgrade to the module, the customer would like to see, at runtime, which fields are missing.<br>
  Consider the following Settings.xml file:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;appSettings&gt;
      &lt;configuration&gt;
          &lt;API&gt;
              &lt;log&gt;
                  &lt;type&gt;09&lt;/type&gt;
                  &lt;location&gt;C:\Test\Test.log&lt;/filename&gt;
              &lt;/log&gt;
          &lt;/API&gt;
      &lt;/configuration&gt;
  &lt;/appSettings&gt;  
  </code></pre>
  
  <p>The settings are currently read into the static class using an XMLReader (seen below):  </p>
  
  <pre><code>        using (XmlTextReader xmlReader = new XmlTextReader("Settings.xml"))
          {
              xmlReader.ReadToFollowing("API");
              xmlReader.ReadToFollowing("log");
              xmlReader.ReadToFollowing("type");
              this.logtype = xmlReader.ReadElementContentAsString(); 
          //snip...
          }
  </code></pre>
  
  <p>This same code is used to read each and every setting.  There has to be a better way.  Is there any way that I can read the XML values into each corresponding property, and generate an error if it's null?<br>
  I'm attempting to design the static Settings class as such:  </p>
  
  <pre><code>public static class Settings
      {
          private static string logtype
  
          public static string LogType
          {
              get
              { return logtype; }
  
              set
              { logtype = value; }
          }
      }
  </code></pre>
  
  <p>And then use something like the following to "grab" the values:  </p>
  
  <pre><code>public static void initSettings()
          {
              appSettings.LogType = read the configuration\API\log\type field from xml;
          }
  </code></pre>
  
  <p>I'm pretty sure that I'd just check for the null character in the property constructor, but how would I do the 'read the configuration\API\log\type field from xml' part of the initSettings method?</p>