tags:

views:

63

answers:

1

Is there a way to get XStream to generate self closing elements?

E.g.

<foo/>

instead of

<foo></foo>
+1  A: 

There doesn't seem to be an explicit way to do this, since it's not supposed to matter to downstream XML processors.

You might take a look at the source for the PrettyPrintWriter class, which is probably what it's using.

Jim Garrison