nsCOMPtr<nsIRDFCompositeDataSource> database; nsCOMPtr<nsISupportsArray> resourceArray, folderArray; nsCOMPtr<nsIRDFResource> resource;  rv = srcFolderElement->GetResource(getter_AddRefs(resource));  if(NS_FAILED(rv)) return rv;  rv = tree->GetDatabase(getter_AddRefs(database)); if(NS_FAILED(rv)) return rv;  rv =ConvertDOMListToResourceArray(nodeList, getter_AddRefs(resourceArray)); if(NS_FAILED(rv)) return rv;
nsCOMPtr<nsISupportsArray> folderArray;
nsMessenger::DeleteMessages(nsIDOMXULElement *tree, nsIDOMXULElement *srcFolderElement, nsIDOMNodeList *nodeList){	nsresult rv;	if(!tree || !srcFolderElement || !nodeList)		return NS_ERROR_NULL_POINTER;	nsCOMPtr<nsIRDFCompositeDataSource> database;	nsCOMPtr<nsISupportsArray> resourceArray, folderArray;	nsCOMPtr<nsIRDFResource> resource;	rv = srcFolderElement->GetResource(getter_AddRefs(resource));	if(NS_FAILED(rv))		return rv;	rv = tree->GetDatabase(getter_AddRefs(database));	if(NS_FAILED(rv))		return rv;	rv =ConvertDOMListToResourceArray(nodeList, getter_AddRefs(resourceArray));	if(NS_FAILED(rv))		return rv;	rv = NS_NewISupportsArray(getter_AddRefs(folderArray));	if(NS_FAILED(rv))	{		return NS_ERROR_OUT_OF_MEMORY;	}	folderArray->AppendElement(resource);		rv = DoCommand(database, NC_RDF_DELETE, folderArray, resourceArray);	return rv;}