How to keep the sitemap.xml automatically fine?


if my domain is,
I put my html pages of the main site in / public_html /,
and I install a blog in / public_html / blog /.

for my main site, sometimes,
I can update manually or upload new pages.

and my blog,
I can write a new post every day.

I think to combine them in a sitemap.xml and send them to the search engine.
I find the article…e-sitemap-file,
You may need a sitemap.xml to combine the two sitemap files as follows:

but you need the label ,
I want to ask if any script or method can update them automatically and update them in the main sitemap?
or It's not important ?