Hey, the modify in the class LibvirtXML is necessary. Look at LibvirtXML.__init__(), LibvirtXML.xml comes from 
self.dict_get('virsh').capabilities(). It's diffrent from VMCPUXML(it comes from self.dict_get('virsh').dumpxml(vm_name + " --update-device")).
Some elements in them are same, but these elements in LibvirtXML are about HOST. In VMCPUXML are about GUEST.