def serialize_value_map(self, map_elem, thedict):
for key, value in sorted((str(k), v) for (k, v) in thedict.items()):<EOL><INDENT>var_elem = SubElement(map_elem, '<STR_LIT>')<EOL>SubElement(var_elem, '<STR_LIT:name>').text = str(key)<EOL>value_elem = SubElement(var_elem, '<STR_LIT:value>')<EOL>self.serialize_value(value_elem, value)<EOL><DEDENT>return map_elem<EOL>
Serializes a dictionary of key/value pairs, where the values are
either strings, or Attrib, or PathAttrib objects.

Example::

    <variable>
        <name>foo</name>
        <value>text</value>
    </variable>
    <variable>
        <name>foo2</name>
        <value><attribute>foobar</attribute></value>
    </variable>