Improve/fix output and processing for xml and json options.