def _data_to_xml(data):
 xml = ''
 for element in data:
  name = element[0]
  val = element[1]
  if (len(element) > 2):
   converter = element[2]
  else:
   converter = None
  if (val is not None):
   if (converter is not None):
    text = _str(converter(_str(val)))
   else:
    text = _str(val)
   xml += ''.join(['<', name, '>', text, '</', name, '>'])
 return xml

def _data_to_xml ( data ) : xml = '' for element in data : name = element [ 0 ] val = element [ 1 ] if ( len ( element ) > 2 ) : converter = element [ 2 ] else : converter = None if ( val is not None ) : if ( converter is not None ) : text = _str ( converter ( _str ( val ) ) ) else : text = _str ( val ) xml += '' . join ( [ '<' , name , '>' , text , '</' , name , '>' ] ) return xml
creates an xml fragment from the specified data .