I'm giving some functionality to a servlet, one of the things I want to do is, when receiving the InputStream (which is basically a PDF document parsed into an XML format) set that data to a String object, then I try to delete all the empty tags, but I haven't got any good result so far:
This is the data the servlet is receiving
<form1>
<GenInfo>
<Section1>
<EmployeeDet>
<Title>999990000</Title>
<Firstname>MIKE</Firstname>
<Surname>SPENCER</Surname>
<CoName/>
<EmpAdd>
<Address><Add1/><Add2/><Town/><County/><Pcode/></Address>
</EmpAdd>
<PosHeld>DEVELOPER</PosHeld>
<Email/>
<ConNo/>
<Nationality/>
<PPSNo/>
<EmpNo/>
</EmployeeDet>
</Section1>
</GenInfo>
</form1>
The final result should be looking like this:
<form1>
<GenInfo>
<Section1>
<EmployeeDet>
<Title>999990000</Title>
<Firstname>MIKE</Firstname>
<Surname>SPENCER</Surname>
<PosHeld>DEVELOPER</PosHeld>
</EmployeeDet>
</Section1>
</GenInfo>
</form1>
My apologies if it is a repeated question but I did some research over similar posts and none of them could provide me the correct approach, that's why I am asking you in a separate post.
Thank you in advance.