Let me quote ome of one important line of that article:
XMLAdapter class can also create an XML document representing the contained tables and fields that have been populated.
So XMLAdapter is not a one way ticket. Besides LoadXML() And ToCursor() there is also AddTableSchema() and ToXML().
The articel also shows with a simple example of a single cursor.
And yes, although you already have your schema, AddTableSchema is needed, at least it's the easiest way to attach a cursor containing data that you want to be part of the xml to generate.
But still you'd need to know what cursors you need and what their structure should be. To determine that, the easiest thing would be to have some sample XML data and first go the route of reading in that XML to vfp cursors, and then go the inverse route. The XML schema still comes in handy to validate the initial XML input and your output data would also be validated against the allowed values for example.
You can determine the structures you need from the xsd, but it includes much overhead information not only about the data types but also allowed value ranges. There is no easy XSDToCursorStructure() command unfortunaltely. That's what the article does not show at least.
If you do o=createobject("xmladapter") and o.xmlschemalocation = getfile("xsd") and locate your xsd file, unfortunately the XmlAdapter does not create the xmltables and xmlfields you'd need to know the database structure in the xmladapters tables collection and each tables item fields collection. It results in o.Tables.Count being 0.
So with a little XMLsample you'd have better luck. Then you could LoadXML, would ideally have a tables collection and with each table could do a ToCursor(), then you'd have the vfp cursor/table structures. And then you could go the reverse way, as already said by AddTableSchema() for each single cursor and then would finally call ToXML after all needed cursors are added.
And the quintessence regarding th xsd: On both the way from xml to vfp cursors and from vfpcursors to xml it's used to validate either the xml or the vfpcursors and their data. But it's not taken to create some CREATE TABLE/CURSOR sql or the tables/cursors themselves. This is beyond the xmladatper class. Perhaps you're lucky with West Winds wwXML class, that has a CreateCursorFromSchema() function, although in this case it would be more than one cursor.
If it won't work for that task, it may help you anyway.
Bye, Olaf.