Adding functions for reformatting xml and json