How to disable pretty-printing(white space/newline) in XStream?
This is how I create XStream instance for XML: XStream xstream = new XStream(); This is for JSON: private final XStream xstream = new XStream(new JsonHierarchicalStreamDriver() { public HierarchicalStreamWriter createWriter(Writer writer) { return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE); } }); Both of them are pretty-printing (indenting) the output. How can I ask the XStream to disable the pretty printing? noclayto Thanks, your posts helped!!! Here is what I use to convert to a String. String strXML = ""; XStream xs = new XStream(); StringWriter sw = new StringWriter(); xs.marshal