May I know how am I suppose to generate XML output based on a given schema? I have a schema with elements and attributes. The value of the attributes will be extracted from Oracle database.

I have tried with my own code but not sure if it's valid

**********************************************
OpenDatabase
'Open App.Path & "\output.xml" For Output As #F
Set RawParaQry = New ADODB.Recordset

'Get DIAMETER Rawdata
RawParaQry.Open "Select Dia1, Dia2, Dia3, Dia4, Dia5, _ & "From DiaTb " _
& "Where DiaTb.Ingot = '" & itemno & "' " _
& "And RawMainTb.Shpinv = '" & invoiceno & "'", S_GateDb

'Execute Query
'Calculate N, Max, Min
ParaN_Dia = 0
ParaMax_Dia = Val(RawParaQry(0)) / 100
ParaMin_Dia = Val(RawParaQry(0)) / 100
'Calculations for ParaMin_Dia, ParaMax_Dia will be done here

'Print #F, " <Diameter N="; "'" & Val(ParaN_Dia) & "'"; " MIN="; "'" & ParaMin_Dia & "'"; " MAX="; "'" & ParaMax_Dia & "'"; "/>"
'Close #F

************************************************
For Print #F statement, how can I display more than one element eg <Dia...../> and next line
<Length....../> and so on


Thanks in advance.