if (aIndex >= (PRUint32) cnt) return NS_ERROR_INVALID_ARG;
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);
nsAnonymousContentList::Item(PRUint32 aIndex, nsIDOMNode** aReturn){  PRUint32 cnt;  nsresult rv = mElements->Count(&cnt);  if (NS_FAILED(rv)) return rv;  if (aIndex >= (PRUint32) cnt)      return NS_ERROR_INVALID_ARG;  // Cast is okay because we're in a closed system.  *aReturn = (nsIDOMNode*) mElements->ElementAt(aIndex);  return NS_OK;}