I have to concert a sql table into certain xml format. this the format i want in this way
<update table ="Courses" StartDate="20220921" EndDate="20220922">
<versions Subject="Gepgraphy" Count="13">
<version SubjectID="AR-0704-1258" VerNum="5" CreateDate="20121017" ModDate="20220921" DeleteDate="00000000" StartDate="201103" EndDate="202209" RCFlag="0">
<titles>
<title Subject="prime">Physical Therapy Specialty</title>
</titles>
<lengths>
<length MinWeeks="10" MinHours="400" />
</lengths>
<courses>
<course CourseID="303-N9" PhaseNumber="2" Service="Army" />
<course CourseID="303-68" Service="navy" />CourseID
</courses>
<locations>
<location LocationID="918" School="Coast Guard Academy" InstallationPlace="New London, CT" />
<location LocationID="915" School="TRACEN" InstallationPlace="Cape May, NJ" />
<location LocationID="849" School="Martin Community Hospital" InstallationPlace="Fort Benning, GA" />
<location LocationID="857" School="Reynolds ACH" InstallationPlace="Fort Sill, OK" />
<location School="Kimbrough ACH" InstallationPlace="Fort Meade, MD" />
I would like to have the title node this way
And like to have all records for Location /CourseID in one place.