Following the example in the post you've linked to and the API, I came up with this code:
char[] indent = new char[] { ' ', ' ', ' ', ' ' };
BufferedOutputStream stdout = new BufferedOutputStream(System.out);
xstream.marshal(object, new PrettyPrintWriter(new OutputStreamWriter(stdout), indent));