+1  A: 

You need to do two steps:

1) Take your XML schema file and run it through the xsd.exe utility (which comes with the Windows SDK - it's in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\ or some similar path. This can turn the XSD file into a C# class:

xsd /c yourfile.xsd

This should give you a file yourfile.cs which contains a class representing that XML schema.

2) Now, armed with that C# class, you should be able to just deserializing the XML file into an instance of your new object:

XmlSerializer ser = new XmlSerializer(typeof(foo));

string filename = Path.Combine(FilePath, "SimpleFields.xml");

foo myFoo = ser.Deserialize(new FileStream(filename, FileMode.Open)) as foo;

if (myFoo != null)
{
   // do whatever you want with your "foo"
}

That's about as simple as it gets! :-)

marc_s
As marc_s had guessed, this question is related to code-generation.I had tried xsd.exeI had also looked at other questions such as [Comparison of xsd codegenerators - C#](http://stackoverflow.com/questions/386155/comparison-of-xsd-codegenerators-c), but most of these options seemed to use XmlSerializer.This isn't in itself a bad thing, but I was wondering if there was another method that cave a bit more control (rather than just binding to the various events of the XmlSerializer class.
Steven_W
+1  A: 

OK - Found the answer I was looking for.

it is the XmlConvert class.

     var el_date = (XmlElement)el_root.SelectSingleNode("./DateVal");
     //WANTED: el_date.Value = 2010-02-18 01:02:03 (as a DateTime Object)
     var val_date = XmlConvert.ToDateTime(el_date.InnerText);
     //ACTUAL: el_date.InnerText="2010-02-18T01:02:03"

     var el_duration = (XmlElement)el_root.SelectSingleNode("./TimeVal");
     //WANTED: el_date.Value = 10 hours, 5 minutes, 3 seconds (as a TimeSpan Object)
     var val_duration = XmlConvert.ToTimeSpan(el_duration.InnerText);
     //ACTUAL: el_date.InnerText="PT10H5M3S"

Marc's answer was correct in terms of reading in a whole strongly-typed class, but in this case I only wanted to read a single strongly-typed element/node.

Steven_W