I have created an XML
using STAX
and XMLStreamWriter. It works fine.
I need to merge two xml together. The problem that I am facing is the patient Pojo returns me XML containing all the patient information is below
<Patient>
<SocialSecurity>3333344</SocialSecurity>
<Name>
<LastName>pillai</LastName>
<FirstName>dhanya</FirstName>
<Name>
<Patient>
I need to add this into existing XML after <proID>
like merging.
<?xml version="1.0" ?>
<Validate>
<proID>123</prodID>
</Validate>
Please advice
The answer is as below