def generate_instance(table, fieldname):
 if table[fieldname].default:
  instance = TAG[fieldname](table[fieldname].default)
 else:
  instance = TAG[fieldname]()
 return instance

def generate_instance ( table , fieldname ) : if table [ fieldname ] . default : instance = TAG [ fieldname ] ( table [ fieldname ] . default ) else : instance = TAG [ fieldname ] ( ) return instance
generates xml for the instance of the specified field .