Make function "randomMAC" public

A function from a different module might require a new random MAC so the
function "randomMAC", defined inside another function in VMIfacesModel,
should be declared in a public scope.

Move the definition of "randomMAC" to outside its outer function in
order to make it public.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Allow updating XML attribute in "xml_item_update"

The function "xml_item_update" only updates the content of any given
tag, filtered by an XPath expression. However, one might want to update
one of the tag's attributes instead of its content.

Add an optional parameter to "xml_item_update" which sets the attribute
name to be updated; if not set, the function will behave as before, i.e.
update the tag's content.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Render different types of data in generate_action_handler

The function "generate_action_handler" creates a function which handles
a string being returned by the underlying action function. However, in
some cases, another type of element might be returned. The action
"swupdate", for example, doesn't use "generate_action_handler" because
it returns a Task instead of a string.

Make the function "generate_action_handler" more modular so it can
process different types of data.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>