I have this string in format of XML
<?xml version="1.0" encoding="UTF-8"?>n
<objectA>n
<command>Existing</command>n
<status>OK</status>n
<values>a lot of values....</values>n
</objectA>
I want to split it to array of string just with the value and content
[0] objectA = ""
[1] command = Existing
[2] status = ok
[3] values = a lot of values....
I tried
result = result.replaceAll(">n<", "><"); //$NON-NLS-1$ //$NON-NLS-2$
Pattern pattern = Pattern.compile("<*?>*?</*?>"); //$NON-NLS-1$
but is is not working for me