I am looking for a way when I need to generate an XML from another XML Response(s). In example below, I have a student list of 50 students and a teacher list of 3 teachers. I want an sections assingnments XML as the output where each teacher is assigned to a section, and upto 20 students are assigned in that section.
So I need to loop on each teacher element, and for each teacher element, loop on the student name from 1-20, than for 2nd teacher, students 21-40 etc.
Ex: I have a XML list of students, say a simple format as follows: