>CLOSE DATABASES all >USE _samples+"\data\customer" IN 0 >SELECT cust_id,order_id,emp_id FROM _samples+"\data\orders" WHERE !EMPTY(shipped_on) INTO CURSOR xx readwrite >INDEX on cust_id TAG cust_id >USE _samples+"\data\orditems" IN 0 ORDER tag order_id >SET RELATION TO order_id INTO 'orditems' IN 'xx' >SET RELATION TO cust_id INTO 'xx' IN 'customer' > >LOCAL oAdapter as XMLAdapter >oAdapter = CREATEOBJECT('xmlAdapter') >oAdapter.RespectNesting = .t. >oAdapter.XMLName=STRCONV('MyNameInsteadOfVFPDataSet',12) >oAdapter.AddTableSchema('customer',.t.) >oAdapter.AddTableSchema('xx',.t.) >oAdapter.AddTableSchema('orditems',.t.) >oAdapter.ToXML('mynestedxml') > >CLOSE DATABASES all >* If you want to see content >STRTOFILE(m.mynestedxml,'xx.txt') >MODIFY FILE xx.txt >ERASE xx.txt > >LOCAL oAdapter as XMLAdapter >oAdapter = CREATEOBJECT('xmlAdapter') >oAdapter.RespectNesting = .t. >*oAdapter.XMLSchemaLocation = 'd:\temp\myExternalsSchema.xsd' >oAdapter.LoadXML(m.mynestedxml) >oAdapter.Tables(1).ToCursor() >oAdapter.Tables(2).ToCursor() >oAdapter.Tables(3).ToCursor() >>Cetin