def _gluster_xml(cmd):
    '''
    Perform a gluster --xml command and log result.
    '''
    # We will pass the command string as stdin to allow for much longer
    # command strings. This is especially useful for creating large volumes
    # where the list of bricks exceeds 128 characters.
    if _get_version() < (3, 6,):
        result = __salt__['cmd.run'](
            'script -q -c "gluster --xml --mode=script"', stdin="{0}\n\004".format(cmd)
        )
    else:
        result = __salt__['cmd.run'](
            'gluster --xml --mode=script', stdin="{0}\n".format(cmd)
        )

    try:
        root = ET.fromstring(_gluster_output_cleanup(result))
    except ET.ParseError:
        raise CommandExecutionError('\n'.join(result.splitlines()[:-1]))

    if _gluster_ok(root):
        output = root.find('output')
        if output is not None:
            log.info('Gluster call "%s" succeeded: %s',
                     cmd,
                     root.find('output').text)
        else:
            log.info('Gluster call "%s" succeeded', cmd)
    else:
        log.error('Failed gluster call: %s: %s',
                  cmd,
                  root.find('opErrstr').text)

    return root