title: Parse XML string to class in C#?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/364253/how-to-deserialize-xml-document">How to Deserialize XML document</a>  </p>
  </blockquote>
  
  
  
  <p>Suppose that I have a class that is defined like this in C#:</p>
  
  <pre><code>public class Book
  {
      public string Title {get; set;}
      public string Subject {get; set;}
      public string Author {get; set;}
  }
  </code></pre>
  
  <p>Suppose that I have XML that looks like this:</p>
  
  <pre><code>&lt;Book&gt;
      &lt;Title&gt;The Lorax&lt;/Title&gt;
      &lt;Subject&gt;Children's Literature&lt;/Subject&gt;
      &lt;Author&gt;Theodor Seuss Geisel&lt;/Author&gt;
  &lt;Book&gt;
  </code></pre>
  
  <p>If I would like to instantiate an instance of the <code>Book</code> class using this XML, the only way I know of to do this is to use the XML Document class and enumerate the XML nodes.</p>
  
  <p>Does the .net framework provide some way of instantiating classes with XML code?  If not, what are the best practices for accomplishing this?</p>