Deserialize XML string
September 18, 2006 by bnma
Use this following static method to convert any xml to its object representation
public static object ToObject(Type objectType, string xml)
{
object obj = null;
try
{
XmlSerializer xs = new XmlSerializer(objectType);
obj = xs.Deserialize(new StringReader(xml));
}
catch (Exception ex)
{
}
return obj;
}