rv = AddDatabasePropertyToHTMLElement(mRoot, mDB);
rv = InitHTMLTemplateRoot();
nsXULTemplateBuilder::SetDataBase(nsIRDFCompositeDataSource* aDataBase){    NS_PRECONDITION(mRoot != nsnull, "not initialized");    if (! mRoot)        return NS_ERROR_NOT_INITIALIZED;        if (mDB)        mDB->RemoveObserver(this);    mDB = dont_QueryInterface(aDataBase);    if (mDB) {        nsresult rv;        mDB->AddObserver(this);        // Now set the database on the element, so that script writers can        // access it.        nsCOMPtr<nsIDOMXULElement> element( do_QueryInterface(mRoot) );        if (element) {            rv = element->SetDatabase(aDataBase);            if (NS_FAILED(rv)) return rv;        }        else {            // Hmm. This must be an HTML element. Try to set it as a            // JS property "by hand".            rv = AddDatabasePropertyToHTMLElement(mRoot, mDB);            if (NS_FAILED(rv)) return rv;        }    }    return NS_OK;}