title: How to easily load a XML-based Config File into a Java Class?
body: <p>I've got a simple java class that looks something like this:<br></p>
  
  <pre><code>public class Skin implements Serializable {
  
      public String scoreFontName = "TahomaBold";
      ...
      public int scoreFontHeight = 20;
      ...
      public int blockSize = 16;
              ...
  
      public int[] nextBlockX = {205, 205, 205, 205};
              ...
      public String backgroundFile = "back.bmp";
              ... 
  }
  </code></pre>
  
  <p><br><br>
  I'd like to read this information from a simple XML file that looks something like this:</p>
  
  <pre><code>&lt;xml&gt;
      &lt;skin&gt;
          &lt;scoreFontName&gt;"Tahoma Bold"&lt;/scoreFontName&gt;
          ...
          &lt;scoreFontHeight&gt;20&lt;/scoreFontHeight&gt;
          ...
          &lt;blockSize&gt;16&lt;/blockSize&gt;
          ...
          &lt;nextBlockX&gt;
               &lt;0&gt;205&lt;/0&gt;
               &lt;1&gt;205&lt;/1&gt;
               &lt;2&gt;205&lt;/2&gt;
               &lt;3&gt;205&lt;/3&gt;
          &lt;nextBlockX&gt;
          ....
          &lt;backgroundFile&gt;"back.bmp"&lt;/backgroundFile&gt;
          ...
       &lt;skin&gt;
   &lt;/xml&gt;
  </code></pre>
  
  <p>Is there an easy way to inject the information from the xml file directly into the variable names rather than having to parse it manually?  I don't mind using an external library.</p>
  
  <p>Any help is appreciated.</p>