virt: xml: add utility functions

Add utility functions factoring out common
operations over the `devices' element of the domain XML.

Change-Id: I883969de4ff8a992303183c92874f09ee073f466
Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29698
Reviewed-by: Dan Kenigsberg <danken@redhat.com>