Hmm,I think libvirtxml.dict_get('xml').write(cpu_xml_file) is enough