title: Converting from String to <T>
body: <p>I really should be able to get this, but I'm just to the point where I think it'd be easier to ask.</p>
  
  <p>In the C# function:</p>
  
  <pre><code>public static T GetValue&lt;T&gt;(String value) where T:new()
  {
     //Magic happens here
  }
  </code></pre>
  
  <p>What's a good implementation for the magic? The idea behind this is that I have xml to parse and the desired values are often primitives (bool, int, string, etc.) and this is the perfect place to use generics... but a simple solution is eluding me at the moment.</p>
  
  <p>btw, here's a sample of the xml I'd need to parse</p>
  
  <pre><code>&lt;Items&gt;
      &lt;item&gt;
          &lt;ItemType&gt;PIANO&lt;/ItemType&gt;
          &lt;Name&gt;A Yamaha piano&lt;/Name&gt;
          &lt;properties&gt;
              &lt;allowUpdates&gt;false&lt;/allowUpdates&gt;
              &lt;allowCopy&gt;true&lt;/allowCopy&gt;
          &lt;/properties&gt;   
      &lt;/item&gt;
      &lt;item&gt;
          &lt;ItemType&gt;PIANO_BENCH&lt;/ItemType&gt;
          &lt;Name&gt;A black piano bench&lt;/Name&gt;
          &lt;properties&gt;
              &lt;allowUpdates&gt;true&lt;/allowUpdates&gt;
              &lt;allowCopy&gt;false&lt;/allowCopy&gt;
              &lt;url&gt;www.yamaha.com&lt;/url&gt;
          &lt;/properties&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;ItemType&gt;DESK_LAMP&lt;/ItemType&gt;
          &lt;Name&gt;A Verilux desk lamp&lt;/Name&gt;
          &lt;properties&gt;
              &lt;allowUpdates&gt;true&lt;/allowUpdates&gt;
              &lt;allowCopy&gt;true&lt;/allowCopy&gt;
              &lt;quantity&gt;2&lt;/quantity&gt;
          &lt;/properties&gt;
      &lt;/item&gt;
  &lt;/Items&gt;
  </code></pre>