Is there any way to preserve character sequences in an XmlDataSet if they are explicitly stored in the database?
You can easily extend the XmlDataSet class and overwrite the methods that write the string values as follows: public class MyXmlWriter extends org.dbunit.dataset.xml.XmlDataSetWriter { … protected void writeValueCData(String stringValue) throws IOException { int k = 0; while((k = str.indexOf(‘\r’)) != -1){ getXmlWriter().writeCData(str.substring(0, k)); getXmlWriter().writeText(“\r”, true); str = str.substring(k + 1); } getXmlWriter().writeCData(str); } protected void writeValue(String stringValue) throws IOException { // Write literally super.getXmlWriter().