So the gas cap seal on my 1978 XS400 has seen better days. It was very cracked and dry rotted and when standing near the bike, released some noticeable gas fumes, though never leaked any gas, thankfully. Googling for a new seal brought up plenty of replacements for the XS650 and other models, or complete gas cap assemblies of questionable quality (and now needing a third key for the new cap) for our XS400's. I had noticed that MikesXS sold just a replacement seal for the XS650, and it looked identical to the seal on our 400's. So I took the $9 gamble and ordered one. It fit perfect! It's maybe a touch thicker than the factory seal, but the cap is spring loaded and has more than enough movement to compensate. Replacing it is a matter of 4 screws, one to remove the cap from the tank and three to hold the seal plate to the cap. You cold probably try to replace it with cap in place too, but I'd rather not risk dropping the tiny screws into the tank opening. No more gas smell while standing next to the bike!
So if you're looking to replace just the rubber seal on your gas cap, go get you one of them. The MikeXS part number is 20-0036. BTW, I'm not a sponsor.