class="java"> XStream xs = new XStream(new XppDriver(new XmlFriendlyReplacer("_-", "_")));//解决解析下划线时出现双下划线 xs.alias("request", Request.class); String xml = xs.toXML(request);