if (aIndex < pointCount) { nsCOMPtr<nsIContent> result; rv = point->ChildAt(aIndex, getter_AddRefs(result)); if (result && NS_SUCCEEDED(rv)) return result->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn); else return rv; } }  return NS_ERROR_FAILURE;
*aReturn = (nsIDOMNode*) mElements->ElementAt(aIndex); return NS_OK;
nsAnonymousContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn){  PRUint32 cnt;  nsresult rv = mElements->Count(&cnt);  if (NS_FAILED(rv)) return rv;  PRUint32 pointCount = 0;  nsCOMPtr<nsIXBLInsertionPoint> point;  for (PRUint32 i = 0; i < cnt; i++) {    aIndex -= pointCount;        point = getter_AddRefs((nsIXBLInsertionPoint*)(mElements->ElementAt(i)));    point->ChildCount(&pointCount);    if (aIndex < pointCount) {      nsCOMPtr<nsIContent> result;      rv = point->ChildAt(aIndex, getter_AddRefs(result));      if (result && NS_SUCCEEDED(rv))        return result->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)aReturn);      else return rv;    }  }  return NS_ERROR_FAILURE;}