def getSourceParameters(context, node):
    """ Extract parameter values for the external source from
    the Document's XML node.
    """
    parameters = {}
    for child in [child for child in node.childNodes if child.nodeType ==
        child.ELEMENT_NODE and child.nodeName == 'parameter']:
        child.normalize()
        name = child.getAttribute('key').encode('ascii')
        type = child.getAttribute('type') or 'string'
        value = [child.nodeValue for child in child.childNodes if child.
            nodeType == child.TEXT_NODE]
        value = ' '.join(value)
        if type == 'list':
            value = eval(value)
        elif type == 'boolean':
            try:
                value = int(value)
            except ValueError:
                value = 0
        parameters[name] = value
    return parameters
