Formatting an XML string
It is easy to run the replaceSpecialCharForXML routine along with a tJava component, to format a string for XML:
System.out.println(TalendString.replaceSpecialCharForXML("Thelma & Louise"));
In this example, the & character is replaced in order to make the string XML compatible:
![The result is "Thelma & Louise" in the Run view.](/en-US/studio-user-guide/8.0-R2024-07/Content/Resources/images/Routines16_c.png)