In a project on which i am working on, we need to create an XML and pass it on to an interface and i am facing issues while creating an XML containing data from parent table and its subsequent child table.
parent table :- Department should be like
dept_id dept_name
1 History
2 Biology
CHild table :- employee should be like
emp_id emp_name dept_id
1 Helen 1
2 Martha 1
3 John 1
4 Carol 2
So the resulting XML should be like for department id=1
`<department>
<dept_id>1</dept_id>
<dept_name>History</dept_name>
</department>
<employee>
<emp_id>1</emp_id>
<emp_name>Helen</emp_name>
</employee>
<employee>
<emp_id>2</emp_id>
<emp_name>Martha</emp_name>
</employee>
<employee>
<emp_id>3</emp_id>
<emp_name>John</emp_name>
</employee>'
If anyone knows a better way of doing this then it would be of great help. Thanks in advance