if (NS_FAILED(rv = element->GetAttribute(kNameSpaceID_XUL,
if (NS_FAILED(rv = element->GetAttribute(kNameSpaceID_None,
RDFXULBuilderImpl::OnUnassert(nsIRDFResource* aSubject,                              nsIRDFResource* aPredicate,                              nsIRDFNode* aObject){    NS_PRECONDITION(mDocument != nsnull, "not initialized");    if (! mDocument)        return NS_ERROR_NOT_INITIALIZED;    // Stuff that we can ignore outright    // XXX is this the best place to put it???    if ((aPredicate == kRDF_nextVal) ||        (aPredicate == kRDF_instanceOf))        return NS_OK;    nsresult rv;    nsCOMPtr<nsISupportsArray> elements;    if (NS_FAILED(rv = NS_NewISupportsArray(getter_AddRefs(elements)))) {        NS_ERROR("unable to create new ISupportsArray");        return rv;    }    // Find all the elements in the content model that correspond to    // aSubject: for each, we'll try to remove XUL children if    // appropriate.    if (NS_FAILED(rv = mDocument->GetElementsForResource(aSubject, elements))) {        NS_ERROR("unable to retrieve elements from resource");        return rv;    }    for (PRInt32 i = elements->Count() - 1; i >= 0; --i) {        nsCOMPtr<nsIContent> element( do_QueryInterface(elements->ElementAt(i)) );                // XXX somehow figure out if removing XUL kids from this        // particular element makes any sense whatsoever.        if (rdf_IsOrdinalProperty(aPredicate)) {            // It's a child node. If the contents of aElement _haven't_            // yet been generated, then just ignore the unassertion. We do            // this because we know that _eventually_ the contents will be            // generated (via CreateContents()) when somebody asks for            // them later.            nsAutoString contentsGenerated;            if (NS_FAILED(rv = element->GetAttribute(kNameSpaceID_XUL,                                                     kContentsGeneratedAtom,                                                     contentsGenerated))) {                NS_ERROR("severe problem trying to get attribute");                return rv;            }            if (rv == NS_CONTENT_ATTR_NOT_THERE || rv == NS_CONTENT_ATTR_NO_VALUE)                continue;            if (! contentsGenerated.EqualsIgnoreCase("true"))                continue;            // Okay, it's a "live" element, so go ahead and remove the            // child from this node.            if (NS_FAILED(RemoveChild(element, aObject))) {                NS_ERROR("problem removing child from content model");                return rv;            }        }        else if (aPredicate == kRDF_type) {            // We shouldn't ever see this: if we do, there ain't much we            // can do.            NS_ERROR("attempt to remove tag type");            return NS_ERROR_UNEXPECTED;        }        else {            // Remove this attribute from the element.            if (NS_FAILED(rv = RemoveAttribute(element, aPredicate, aObject))) {                NS_ERROR("unable to remove attribute to the element");                return rv;            }        }    }    return NS_OK;}