It will return a ValueError if text is not an integer(not hex and oct too).
Maybe catch it and raise a LibvirtXMLError will be more suitable.