To have a generator you need well defined structure. Both JSON and XML are just a way to describe data of any structure. You can probably write the generator to create class for the given XML or JSON snippet but it doesn't mean that the next snippet generated by the same source will have the same structure. For example your initial snippet can miss some optional data structures which will be included in the next snippet. Because of that generic generator doesn't make too much sense.
.NET offers tool to generate class from XML but the XML must be described by XSD - it clearly communicates valid structure of exchanged XML. The tool is called XSD.exe. In the same way you can create DataContracts from XSD by svcutil.exe with /dconly.