def dict_to_xml_schema(data):
 for (key, value) in data.items():
  root = _add_element_attrs(ET.Element(key), value.get('attrs', {}))
  children = value.get('children', None)
  if isinstance(children, dict):
   _add_sub_elements_from_dict(root, children)
  return root

def dict_to_xml_schema ( data ) : for ( key , value ) in data . items ( ) : root = _add_element_attrs ( ET . Element ( key ) , value . get ( 'attrs' , { } ) ) children = value . get ( 'children' , None ) if isinstance ( children , dict ) : _add_sub_elements_from_dict ( root , children ) return root
input a dictionary to be converted to xml .