[CDE-262] - Fixed cdv and xml export and added the functionality to down...

...load json and xml files if an attachment name is provided. Check style applied