Extract XML blocks as string in Java



I have an XML as below



<accountProducts>
<accountProduct>...</accountProduct>
<accountProduct>...</accountProduct>
<accountProduct>...</accountProduct>
<accountProduct>...</accountProduct>
</accountProducts>


Now I want to extract each of the accountProduct block as string. So is there any XML parsing technique to do that or I need to do string manipulation.


Any help please.


No comments:

Post a Comment