Dump a ValueTree instance, returning its dict representation.

    :param values:
    :type values: ValueTree
    :return:
    :rtype: dict

def dump(values):
    """
    Dump a ValueTree instance, returning its dict representation.

    :param values:
    :type values: ValueTree
    :return:
    :rtype: dict
    """
    root = {}
    def _dump(_values, container):
        for name,value in _values._values.items():
            if isinstance(value, ValueTree):
                container[name] = _dump(value, {})
            elif isinstance(value, list):
                items = []
                for item in value:
                    if not isinstance(item, str):
                        raise ValueError()
                    items.append(item)
                container[name] = items
            elif isinstance(value, str):
                container[name] = value
            else:
                raise ValueError()
        return container
    return _dump(values, root)