the solution mentioned in the above link https://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/ worked for me.
I added following code to wp-includes/feed-rss2.php and it worked
$out = ob_get_contents();
$out = str_replace(array(“\n”, “\r”, “\t”, ” “), “”, $input);
ob_end_clean();
However when first I applied the above code it did not work, then I realized that ‘WP Super Cache’ may be showing the same page again, I deleted all the cached pages and it started working.
thank you all.