more complexity to JSON/Xtemplate output