def _add_sld_boilerplate(symbolizer):
 return (('\n<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"\n  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">\n  <NamedLayer>\n    <Name>%(name)s</Name>\n    <UserStyle>\n    <Name>%(name)s</Name>\n    <Title>%(name)s</Title>\n      <FeatureTypeStyle>\n        <Rule>\n' + symbolizer) + '\n        </Rule>\n      </FeatureTypeStyle>\n    </UserStyle>\n  </NamedLayer>\n</StyledLayerDescriptor>\n')

def _add_sld_boilerplate ( symbolizer ) : return ( ( '\n<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"\n  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">\n  <NamedLayer>\n    <Name>%(name)s</Name>\n    <UserStyle>\n    <Name>%(name)s</Name>\n    <Title>%(name)s</Title>\n      <FeatureTypeStyle>\n        <Rule>\n' + symbolizer ) + '\n        </Rule>\n      </FeatureTypeStyle>\n    </UserStyle>\n  </NamedLayer>\n</StyledLayerDescriptor>\n' )
wrap an xml snippet representing a single symbolizer in the appropriate elements to make it a valid sld which applies that symbolizer to all features .