Hello,
We apologize for the issue you are facing with your sitemap XML validation. The error you mentioned indicates that there is an invalid XML syntax due to having two XML declarations on the same line. This can happen if there is a stylesheet reference included incorrectly.
To resolve this issue, please follow these steps:
- Check Your Sitemap Source: Open your sitemap in a browser and view the page source. Look for any lines that contain `
Sources:
How to Fix Whitespace Errors Breaking Your XML Sitemap in WordPress » Rank Math
Rank Math Sitemap Issues and Their Fixes » Rank Math
Hello,
Thank you for reaching out to us.
We tested your sitemap in the validator – https://www.xml-sitemaps.com/validate-xml-sitemap.html, and no issues were detected:

Please follow the steps below for initial troubleshooting:
1. Flush the Sitemap cache by following this video screencast:
https://i.rankmath.com/pipRDp
2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article: https://rankmath.com/kb/exclude-sitemaps-from-caching/
If the issue persists then try disabling the transient cache for the sitemap. This will make sure that your XML sitemap always reflects the latest changes on your site. Kindly add this code snippet to your site:
/**
* Filter if XML sitemap transient cache is enabled.
*
* @param boolean $unsigned Enable cache or not, defaults to true
*/
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
If you’re not sure how to add this code, you can follow this guide: https://rankmath.com/kb/wordpress-hooks-actions-filters/.
After you add the code, please clear any cache on your site or server and check your XML sitemap again. If you’re still facing issues with the sitemap, please let us know – we are happy to investigate further.
Hello
Try the validator I shared which validates the XML code itself not the xml sitemap.
The issue is about XML code as previously mentioned.
It is being detected by almost all SEO tools.
Waiting for your response.
Hello,
We checked your sitemap with this tool, but we were not able to find any errors there. Here’s a screencast for your reference: https://i.rankmath.com/v/JhbQfl
If you’re still facing the issue, please share a screencast with us using a tool like https://loom.com so that we can check the issue further for you.
Looking forward to helping you.
Thank you.
Here is semrush response ragarding this issue :
Thank you so much for reaching out!
My name is Jelena, and I’m with the Semrush Product Support Team — I’m here to help.
The issue you’re seeing — “1 sitemap.xml file has format errors” — is related to the way the first line of your sitemap file is structured. Currently, it looks like this:
<?xml version=”1.0″ encoding=”UTF-8″?><?xml-stylesheet type=”text/xsl” href=”//sfnemploi.com/main-sitemap.xsl”?>
The correct way to format it is to place the XML Declaration and the XSL Stylesheet Processing Instruction on separate lines, like this:
<?xml version=”1.0″ encoding=”UTF-8″?> <?xml-stylesheet type=”text/xsl” href=”https://sfnemploi.com/main-sitemap.xsl”?>
In addition, your href currently uses a protocol-relative URL (//). For best practice and full compliance, it’s recommended to replace that with a full HTTPS URL, as shown above.
You can find more details about proper sitemap formatting here:
Sitemaps.org protocol guide
Semrush blog: How to create and fix XML sitemaps
Once the sitemap is formatted this way, please re-run your Site Audit campaign and the error should disappear in your Site Audit report.
Please let me know once you’ve made the changes — I’ll be happy to recheck it for you!
Kind Regards,
Hello,
Thank you for bringing this up.
The message you’re seeing isn’t an actual issue. The sitemap is still valid and will be processed correctly by Google Search Console. Other SEO plugins like Yoast also generate sitemaps in a similar format, so there’s no need to worry.
Here’s a screenshot of the sitemap generated by Yoast:

Kindly go ahead and submit it to Google Search Console, and it should work without any problems.
Hope that helps.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.