(#3) Make xmlgen.c use libxml2 instead of hacking it out manually
(#3) Make xmlgen.c use libxml2 instead of hacking it out manually

Now that our XML generation is getting complex enough, I think it's worth
using libxml2 to build a proper DOM tree and XML string.

Note that due to the invasiveness of this patch, it's almost unreadable.  It
may be easier to review after it's applied to the tree.  Also, it deserves
some serious review and testing for correctness and error-handling abilities.

Comments on this approach are welcome too, of course.

Changes:
 - Fixed device_to_xml double-free crash
 - Fixed potential leak on unknown device type
 - Fixed inclusion of <uuid> tag in generated XML
 - Moved to using xmlSave API and added tree_to_xml

Signed-off-by: Dan Smith <787803eb1755f35291827d0f0268aa9bc7a57464@us.ibm.com>

libvirt/libvirt-cim,libvirt/libvirt-cim,libvirt/libvirt-cim