If we are developing a Java application which uses the Ajax Technology and wants to transform or convert XML output is necessary in most cases.
   So in conversion of those XML,we mainly get some Problems (For example in autocomplete text field which uses AJAX ,if data came from database or some other resource contains characters like '&','<','>' we get a problem.To overcome this problem follow the bellow things.

1.What ever String u get to put under opening and closing tags must be replaced.
Java Examples:
1.String s="L & T Company";
   String needed=s.replace("&","&amp;");

2. String s="ABC > XYZ";
    String needed=s.replace(">","&gt;");