@cevich ,Agreed. I will check xml by "virt-xml-validate" command.
BTW, I think "virt-xml-validate" can be made to be api for libguestfs module in the future.