Can I generate a C# class from an XML file?
You can use xsd as suggested by Darin.
In addition to that it is recommended to edit the test.xsd-file to create a more reasonable schema.
type="xs:string" can be changed to type="xs:int" for integer values
minOccurs="0" can be changed to minOccurs="1" where the field is required
maxOccurs="unbounded" can be changed to maxOccurs="1" where only one item is allowed
You can create more advanced xsd-s if you want to validate your data further, but this will at least give you reasonable data types in the generated c#.