using System.Xml.Serialization;
public static void Main()
getData<PerfStatusCustomization>(null, "<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<PerfStatusCustomization xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <ClsSchemeID>101</ClsSchemeID>\r\n</PerfStatusCustomization>");
public class PerfStatusCustomization
public int ClsSchemeID { get; set;}
private static void getData<T>(T objectcust, string customizationXML) where T : class
var serializer = new XmlSerializer(typeof(T));
using (TextReader reader = new StringReader(customizationXML))
objectcust = (T)serializer.Deserialize(reader);