def restoreMember(memberType, name, extra, params, body):
    """Re-creates an XBL member element from parts created by iterateMembers."""
    
    if memberType == "method":
        paramText = ""
        for param in params:
            paramText += """        <parameter name="%s"/>\n""" % param

        return """<method name="%s">\n%s        <body><![CDATA[%s]]>""" \
            % (name, paramText, body)
    
    elif memberType == "handler":
        return """<handler %s>\n        <![CDATA[%s]]>""" % (extra, body)

    elif memberType == "constructor":
        return """<constructor>\n        <![CDATA[%s]]>""" % (body)

    elif memberType == "destructor":
        return """<destructor>\n        <![CDATA[%s]]>""" % (body)

    elif memberType == "property":
        return """<property name="%s">""" % (name)

    elif memberType == "getter":
        return """<getter>\n        <![CDATA[%s]]>""" % (body)

    elif memberType == "setter":
        return """<setter>\n        <![CDATA[%s]]>""" % (body)