creating objects from xml file

Hey I am new to using the System.Reflection namespace, but I am trying to learn it in a hurry because I was just assigned a task. I have this xml file that contains class information (eg the fields of the class and the associated values). I want to take the xml data and create an object from the xml file I read. I have worked on the problem and have only been able to do this much. Any help would be much appreciated. Thanks
[code]
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Data;
using System.IO;
using System.Xml;
namespace Parser
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Deserializer
{
public Deserializer()
{
//
// TODO: Add constructor logic here
//
}
public object GetRequestObject(Type serviceType, string
webMethodName)
{

string propertyName= null;

MethodInfo info = serviceType.GetMethod(webMethodName);

Type responseType = info.ReturnType;
ConstructorInfo requestConstructor =
responseType.GetConstructor(Type.EmptyTypes);

//Construct the request object
object requestObject = requestConstructor.Invoke(null);
object childObject=null;


PropertyInfo property = responseType.GetProperty(propertyName);
}
}
}
[/code]

[1485 byte] By [wildkard] at [2008-1-25]
# 1
If your XML matches the output of the XmlSerializer then you might be able to just do this:

XmlSerializer s = new XmlSerializer(serviceType);
object o = s.Deserialize(streamOfXml);
return o;

ChrisLovett at 2007-8-21 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified