Added support for wire-optimized (default) and pretty-printed output for both xml and json using the -pretty option.