Is it possible to generate classes from an xml file?-Collection of common programming errors
This is possible – the XSD will be approximate (it will conform to the document you give the tool, which may or may not be what you are looking for).
xsd.exe has this functionality.
From the several modes of operation:
XML to XSD: Generates an XML schema from an XML file.
And:
XSD to Classes: Generates runtime classes from an XSD schema file. The generated classes can be used in conjunction with System.Xml.Serialization.XmlSerializer to read and write XML code that follows the schema.
Which give you an automated way to classes from an XML file.