Hi
Thnaks .. I finally did it like this.. Dot kno ifits gud enough ut it works...
import java.util.HashMap;
public class Test
{
public static void main(String[] args)
{
StringBuffer sb = new StringBuffer("<fieldname>serviceId</fieldname><fieldvalue>Eligibility</fieldvalue><fieldname>serviceId3</fieldname><fieldvalue>Eligibility3</fieldvalue><fieldname>serviceId1</fieldname><fieldvalue>Eligibility1</fieldvalue>");
String message = sb.toString();
String namestartTag = "<fieldname>";
String nameendTag = "</fieldname>";
String valuestartTag = "<fieldvalue>";
String valueendTag = "</fieldvalue>";
int startTagLocation = 0;
int endTagLocation = 0;
int valuestartTagLocation = 0;
int valueendTagLocation = 0;
startTagLocation = message.indexOf(namestartTag);
endTagLocation = message.indexOf(nameendTag);
HashMap h = new HashMap();
while(startTagLocation != -1)
{
String str1 = message.substring(startTagLocation+namestartTag.length(),endTagLocation);
System.out.println("str1-----"+str1);
String str_remain = message.substring(endTagLocation+nameendTag.length());
valuestartTagLocation = str_remain.indexOf(valuestartTag);
valueendTagLocation = str_remain.indexOf(valueendTag);
String str_value = str_remain.substring(valuestartTagLocation+valuestartTag.length(),valueendTagLocation );
message = str_remain.substring( valueendTagLocation+valueendTag.length());
startTagLocation = message.indexOf(namestartTag);
endTagLocation = message.indexOf(nameendTag);
h.put(str1,str_value);
} //while
System.out.println("serviceid" + h.get("serviceId"));
}//metod
}//clas