if (!mDataSource || !mContainer) return NS_ERROR_NOT_INITIALIZED;
RDFContainerImpl::RemoveElement(nsIRDFNode *aElement, PRBool aRenumber){    NS_PRECONDITION(aElement != nsnull, "null ptr");    if (! aElement)        return NS_ERROR_NULL_POINTER;    nsresult rv;    PRInt32 idx;    rv = IndexOf(aElement, &idx);    if (NS_FAILED(rv)) return rv;    if (idx < 0)        return NS_OK;    // Remove the element.    nsCOMPtr<nsIRDFResource> ordinal;    rv = gRDFContainerUtils->IndexToOrdinalResource(idx,                                                    getter_AddRefs(ordinal));    if (NS_FAILED(rv)) return rv;    rv = mDataSource->Unassert(mContainer, ordinal, aElement);    if (NS_FAILED(rv)) return rv;    if (aRenumber) {        // Now slide the rest of the collection backwards to fill in        // the gap. This will have the side effect of completely        // renumber the container from index to the end.        rv = Renumber(idx + 1, -1);        if (NS_FAILED(rv)) return rv;    }    return NS_OK;}