My question is how we can embed this type of code in your kml export function, so that when we click on "export as kml in leaflet marker" this code is generated/embeded within the leaflet exported kml file.
This code is my wmz export as kmz/kml: Which is working fine inside Google earth you can try by saving this file as kml or kmz and open it in Google earth.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
I think there is a <URL> and <Networklink> Tag which are not generated/handled when we click on the export kml function of leaflet marker, that is why output of the kml is only showing marker but not WMS layer as well(if WMS layer enable before exporting the kml in leaflet marker).