'Make a new Composite.Provider.
Arguments:
layer:
The current TileStache.Core.Layer
stack:
A list or dictionary with configuration for the image stack, parsed
by build_stack(). Also acceptable is a URL to a JSON file.
stackfile:
*Deprecated* filename for an XML representation of the image stack.'

def __init__(self, layer, stack=None, stackfile=None):

    self.layer = layer
    if (type(stack) in (str, unicode)):
        stack = jsonload(urlopen(urljoin(layer.config.dirpath, stack)).read())
    if (type(stack) in (list, dict)):
        self.stack = build_stack(stack)
    elif ((stack is None) and stackfile):
        stackfile = pathjoin(self.layer.config.dirpath, stackfile)
        stack = parseXML(stackfile).firstChild
        assert (stack.tagName == 'stack'), ('Expecting    root    element    "stack"    but    got    "%s"' % stack.tagName)
        self.stack = makeStack(stack)
    else:
        raise Exception(('Note    sure    what    to    do    with    this    stack    argument:    %s' % repr(stack)))
