Hi Friends
I need to create a XML file in the following format

<?xml version=â??1.0â?? ?> Processing Instruction (1 of this type *).
<Rootnode> Main Root Node â?? only one of these allowed.
<ChildNode> Start of Child nodes (Records).
<Field1>MyData</Field1> Start of Data (Fields and Values).
</ChildNode>
<ChildNode> Start of Next Record.
<Field1>MyData</Field1> Start of Data (Fields and Values).
</ChildNode>
</Rootnode>

and i've following code
LOCAL oXMLadapter as XMLAdapter
oXMLadapter = CREATEOBJECT("XMLAdapter")
WITH oXMLadapter
.AddTableSchema('nhi') && content parent node
.AddTableSchema('medical') && child
.AddTableSchema('diagnosis') && child
.ForceCloseTag= .T. && maintain open and close tags
.RespectCursorCP = .T.
.UTF8Encoded = .T.
*--XML file will created according to XSD file (schema)
.XMLSchemaLocation = "C:\OpthalmologyVirtualConsultationPatientSchema.xsd"
.ToXML('c:\xx.xml',,.T.)
ENDWITH

my abv code displaying child nodes as different parents i mean
<?xml version=â??1.0â?? ?> Processing Instruction (1 of this type *).
<Rootnode> &&this is NHI
<Rootnode2> &&medical
<Field1>MyData</Field1> Start of Data (Fields and Values).
</Rootnode2>
<Rootnode3> && diagnosis
<Field1>MyData</Field1> Start of Data (Fields and Values).
</Rootnode3>
</Rootnode>

any ideas on how to fix this
Thanks
--
cheers