I have a string whose content is an XML. I want to separate the tags and make it into a list of string in Java. Below is a something what I am trying:
string xml="<hello><hi a='a' b='b'/><hi a='b' b='a'/></hello>";
I want to separate it into a list like:
list[0]="<hi a='a' b='b'/>"
list[1]="<hi a='b' b='a'/>"
I tried to do this via JAXB processor but doesn't work well. Also tried some stupid logic using split but that didn't help either. Is there any other way to achieve this?