xml2array refactoring

Signed-off-by: Fabien Crassat <fabien@crassat.com>