When using XStream to serialise Java object into XML, alias name with undercore (_) will get duplicate. For example, "first_name" will be serialised as "first__name".
The reason is explained in their FAQ and the workaround is to provide your own XmlFriendlyReplacer. However, it do not give any example. So here is the example:
// replace $ with "ddd"
// replace underscore with underscore
XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("ddd", "_");
XStream xstream = new XStream(new DomDriver("UTF-8", replacer));