First I checkout the open source Java IDEs.
- Netbeans had a beautiful editor to visualize and edit a XSD schema in a graphical tree structure. But unfortunately it did not have the ability to generate sample XML file or vice versa.
- Eclipse too had a visual editor and allowed visual editing of schema elements. It could generate a sample XML file from a XSD file, but had no option for the reverse; i.e. generating a schema file from a sample XML.
- VS 2008 SP1 had both the options - coversion between XML and XSD. For schema files, right click on a node in XSD Explorer view and select "Generate XML". For XML files, select "Tools -> Generate schema" to create the XSD file. Both these operations are very quick in Visual Studio.
- VS 2010 has extensive support for XML tooling. You have 3 different views for schema designing that should suffice for most complex schema definition.
Besides these free tools, there are other command line tools that can be used. For e.g.
XSD.exe tool can be schema to XML and vice versa transformation.
There was another .NET tool that I found on MSDN for generating XML documents from XSD.
Another cool Java desktop tool that supported these features was XMLSpear.