Theme development – how do i add url and homepage modification date to sitemap.xml in wordpress?

I use this code to add sitemap.xml to my WordPress site without a plugin. that works great. but is incomplete. Please add the URL and the modification date of the WordPress homepage (index.php) to this sitemap. I display my recently published and recently changed contributions on my homepage.

    function xml_sitemap(){$postsForSitemap=get_posts(array('numberposts'=>-1,'orderby'=>'modified','post_type'=>array('post'),'order'=>'DESC'));$sitemap='';$sitemap.='';foreach($postsForSitemap as $post){setup_postdata($post);$sitemap.=''.''.get_permalink($post->ID).''.''.get_the_modified_date('c',$post->ID).''.''}$sitemap.='';$fp=fopen(ABSPATH."sitemap.xml",'w');fwrite($fp,$sitemap);fclose($fp)}add_action("publish_post","xml_sitemap")