if (container) {
if (container && IsTreeWidgetItem(aElement)) {
RDFGenericBuilderImpl::OpenContainer(nsIContent* aElement){    nsresult rv;    // First, make sure that the element is in the right widget -- ours.    if (!IsElementInWidget(aElement))        return NS_OK;    nsCOMPtr<nsIRDFResource> resource;    rv = gXULUtils->GetElementRefResource(aElement, getter_AddRefs(resource));    // If it has no resource, there's nothing that we need to be    // concerned about here.    if (NS_FAILED(rv))        return NS_OK;    // The element has a resource; that means that it corresponds    // to something in the graph, so we need to go to the graph to    // create its contents.    //    // Create the container's contents "quietly" (i.e., |aNotify ==    // PR_FALSE|), and then use the |container| and |newIndex| to    // notify layout where content got created.    nsCOMPtr<nsIContent> container;    PRInt32 newIndex;    rv = CreateContainerContents(aElement, resource, PR_FALSE, getter_AddRefs(container), &newIndex);    if (NS_FAILED(rv)) return rv;    if (container) {        nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);        if (! doc)            return NS_ERROR_UNEXPECTED;        rv = doc->ContentAppended(container, newIndex);        if (NS_FAILED(rv)) return rv;    }    return NS_OK;}