rv = GetElementResource(kid, getter_AddRefs(resource));
rv = nsRDFContentUtils::GetElementResource(kid, getter_AddRefs(resource));
RDFToolbarBuilderImpl::RemoveWidgetItem(nsIContent* aToolbarItemElement,                                        nsIRDFResource* aProperty,                                        nsIRDFResource* aValue){    nsresult rv;    // Find the doomed kid and blow it away.    PRInt32 count;    if (NS_FAILED(rv = aToolbarItemElement->ChildCount(count)))        return rv;    for (PRInt32 i = 0; i < count; ++i) {        nsCOMPtr<nsIContent> kid;        rv = aToolbarItemElement->ChildAt(i, *getter_AddRefs(kid));        if (NS_FAILED(rv)) return rv;        // Make sure it's a <xul:toolbar> or <xul:titledbutton>        PRInt32 nameSpaceID;        rv = kid->GetNameSpaceID(nameSpaceID);        if (NS_FAILED(rv)) return rv;        if (nameSpaceID != kNameSpaceID_XUL)            continue; // wrong namespace        nsCOMPtr<nsIAtom> tag;        rv = kid->GetTag(*getter_AddRefs(tag));        if (NS_FAILED(rv)) return rv;        if ((tag.get() != kTitledButtonAtom) &&            (tag.get() != kToolbarAtom))            continue; // wrong tag        // Now get the resource ID from the RDF:ID attribute. We do it        // via the content model, because you're never sure who        // might've added this stuff in...        nsCOMPtr<nsIRDFResource> resource;        rv = GetElementResource(kid, getter_AddRefs(resource));        NS_ASSERTION(NS_SUCCEEDED(rv), "severe error retrieving resource");        if(NS_FAILED(rv)) return rv;        if (resource.get() != aValue)            continue; // not the resource we want        // Fount it! Now kill it.        rv = aToolbarItemElement->RemoveChildAt(i, PR_TRUE);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to remove xul:toolbar/titledbutton from xul:toolbar");        if (NS_FAILED(rv)) return rv;        return NS_OK;    }    // XXX make this a warning    NS_WARNING("unable to find child to remove");    return NS_OK;}