Convert a String to XML Element in Java

How do I convert the following string into XML element using JAVA

String: TeacherId=ABCDEFGH&Action=Student&StudentId.Id.1=1001&StudentId.Id.2=1002&ClassRoom=12B&Year=2020

Excepted Output:

<School> <ClassRoom>12B</ClassRoom>     <StudentId>         <Id>1001</Id>         <Id>1002</Id>     </StudentId>  </School> 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.