oXML = CREA("xmlAdapter") SELECT * FROM condoCatalog WHERE LEFT(NAME,1)="B" INTO TABLE x_Condos INDEX ON id TAG id SELECT * FROM Condobuildings ; inner JOIN x_Condos ; ON condo_id = x_Condos.ID ; INTO TABLE x_CondosBuildings CREATE DATABASE dbc_Temp SET DATABASE TO dbc_Temp USE IN x_Condos USE IN x_CondosBuildings ADD TABLE x_Condos ADD TABLE x_CondosBuildings ALTER TABLE x_Condos ADD PRIMARY KEY id TAG id ALTER TABLE x_CondosBuildings ; ADD FOREIGN KEY condo_id TAG ; condo_id REFERENCES x_Condos TAG ID oXML.ADDTABLESCHEMA("x_Condos") oXML.ADDTABLESCHEMA("x_CondosBuildings") oXML.UTF8ENCODED = .T. && cursor contains international characters oXML.ISDIFFGRAM = .F. && Generate an XML DiffGram lcSchemaLocation = '' && Our schema is inline llIsFile = .F. && Our XML is a stream llIncludeBefore = .T. && Include <diffgram:before> format llChangesOnly = .F. && Generate only changes we made oXML.TOXML('lcXML', lcSchemaLocation, llIsFile, llIncludeBefore, llChangesOnly) STRTOFILE( lcXML , "greg.xml" ) MODIFY FILE "greg.xml"I tried setting relationships between the two tables, tried putting them in a dbc and setting a persistent relationship ??? Does anyone know how to tell the xmlAdapter object to output the two tables as a heirarchal relationship and how to tell it what the relationship is based on ?