Parse XML string to class in C#? [closed]

0x90

New Member
\[quote\] Possible Duplicate:
How to Deserialize XML document \[/quote\]Suppose that I have a class that is defined like this in C#:\[code\]public class Book{ public string Title {get; set;} public string Subject {get; set;} public string Author {get; set;}}\[/code\]Suppose that I have XML that looks like this:\[code\]<Book> <Title>The Lorax</Title> <Subject>Children's Literature</Subject> <Author>Theodor Seuss Geisel</Author><Book>\[/code\]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.Does the .net framework provide some way of instantiating classes with XML code? If not, what are the best practices for accomplishing this?
 
Back
Top