If i have a complex XML file, is there a cheap or free way to get a rough approximation of an XSD from it?
If you use Visual Studio, it includes a console program called xsd.exe that can automatically generate schemas from xml.
It also can automatically generate classes or datasets from schemas.
Yes. There are tools that can analyse your XML and provide an XSD. For example, Visual Studio 2005 and 2008 include a Create XSD command from within the IDE as well as a command line tool, xsd.exe, that will do this.
However, note that it can only deduce the XSD from your provided XML, so the XSD may only validate that one file correctly. Once you've created your XSD, you should consider refactoring it against other XML files to ensure it properly fits the format you want to validate.
XmlSpy also has this feature. If it's better than VS i don't know. But for working with xml and xsds I prefer et over VS any day