SyntaxFix
Write A Post
Hire A Developer
Questions
1-liner, takes a XML string text and YourType as the expected object type. not very different from other answers, just compressed to 1 line:
text
YourType
var result = (YourType)new XmlSerializer(typeof(YourType)).Deserialize(new StringReader(text));