rv = SynchronizeUsingTemplate(templateNode, element, aAction, aProperty, aTarget);
Match match; mContentSupportMap.Get(element, &match);  rv = SynchronizeUsingTemplate(templateNode, element, aAction, match, aProperty, aTarget);
nsXULTemplateBuilder::SynchronizeAll(nsIRDFResource* aSource,                                     nsIRDFResource* aProperty,                                     nsIRDFNode* aTarget,                                     UpdateAction aAction){    // Find all the elements in the content model that correspond to    // aSource: for each, we'll try to build XUL children if    // appropriate.    nsresult rv;    nsCOMPtr<nsISupportsArray> elements;    rv = NS_NewISupportsArray(getter_AddRefs(elements));    NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create new ISupportsArray");    if (NS_FAILED(rv)) return rv;    rv = GetElementsForResource(aSource, elements);    NS_ASSERTION(NS_SUCCEEDED(rv), "unable to retrieve elements from resource");    if (NS_FAILED(rv)) return rv;    PRUint32 cnt;    rv = elements->Count(&cnt);    if (NS_FAILED(rv)) return rv;    for (PRInt32 i = PRInt32(cnt) - 1; i >= 0; --i) {        nsISupports* isupports = elements->ElementAt(i);        nsCOMPtr<nsIContent> element( do_QueryInterface(isupports) );        NS_IF_RELEASE(isupports);        // XXX somehow figure out if building XUL kids on this        // particular element makes any sense whatsoever.        // We'll start by making sure that the element at least has        // the same parent has the content model builder's root        if (!IsElementInWidget(element))            continue;        nsAutoString templateID;        rv = element->GetAttribute(kNameSpaceID_None,                                   nsXULAtoms::Template,                                   templateID);        if (NS_FAILED(rv)) return rv;        if (rv != NS_CONTENT_ATTR_HAS_VALUE)            continue;        nsCOMPtr<nsIDOMXULDocument>    xulDoc;        xulDoc = do_QueryInterface(mDocument);        if (! xulDoc)            return NS_ERROR_UNEXPECTED;        nsCOMPtr<nsIDOMElement>    domElement;        rv = xulDoc->GetElementById(templateID, getter_AddRefs(domElement));        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to find template node");        if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIContent> templateNode = do_QueryInterface(domElement);        if (! templateNode)            return NS_ERROR_UNEXPECTED;        // this node was created by a XUL template, so update it accordingly        rv = SynchronizeUsingTemplate(templateNode, element, aAction, aProperty, aTarget);        if (NS_FAILED(rv)) return rv;    }    return NS_OK;}