hi, I am trying to make an xml file where the first element is called "NEWAPPOINTMENTS" then the next is called "APPOINTMENT" then within APPOINTMENT info such as "START" "END" "SUBJECT" so far I have attempted this using the following code:

VB Code:
  1. Set objDOM = New DOMDocument
  2.                
  3.                 objDOM.preserveWhiteSpace = True
  4.                 Set objRow = objDOM.createElement("NEWAPPOINTMENTS")
  5.                 objDOM.appendChild objRow
  6.                    
  7.                 Set objField = objDOM.createElement("APPOINTMENT")
  8.                 objRow.appendChild objField
  9.  
  10.                 Set objField = objDOM.createElement("START")
  11.                 objField.nodeTypedValue = oItem.Start
  12.                 objRow.appendChild objField
  13.        
  14.              
  15.                 Set objField = objDOM.createElement("END")
  16.                 objField.nodeTypedValue = oItem.End
  17.                 objRow.appendChild objField
  18.        
  19.              
  20.                 Set objField = objDOM.createElement("SUBJECT")
  21.                 'objField.dataType = "dateTime"
  22.                 objField.nodeTypedValue = oItem.Subject
  23.                 objRow.appendChild objField


this creates me an xml file but dosent put the start, end and subject within the Appointment element, and if i try to make the APPOINTMENT element as appendChild.objRow then i get an error "only one top lvl element allowed"

many thanks for any help