def xml_add_items(data):
 try:
  xml = ''.join([xml_item(item) for item in data[config.ITEMS]])
 except:
  xml = xml_dict(data)
 return xml

def xml_add_items ( data ) : try : xml = '' . join ( [ xml_item ( item ) for item in data [ config . ITEMS ] ] ) except : xml = xml_dict ( data ) return xml
when this function is called the datastream can only contain a _items list .