nodeInfo->GetNameAtom(*aElementName);
nsCOMPtr<nsIAtom> name = nodeInfo->GetNameAtom(); *aElementName = name; NS_ADDREF(*aElementName);
  nsresult GetNextChild(nsIDOMElement** aChildElement,                        nsIAtom** aElementName)  {    *aChildElement = nsnull;        if (!mNodeList) {      return NS_ERROR_FAILURE;    }    nsCOMPtr<nsIDOMNode> child;     while (mIndex < mLength) {      mNodeList->Item(mIndex++, getter_AddRefs(child));      nsCOMPtr<nsIDOMElement> childElement(do_QueryInterface(child));      if (!childElement) {        continue;      }            // Confirm that the element is an element of the specified namespace      nsAutoString namespaceURI;                 childElement->GetNamespaceURI(namespaceURI);        if (!mNamespace.IsEmpty()) {        if (!namespaceURI.Equals(mNamespace)) {          continue;        }      }      else if (mNumNamespaces) {        PRUint32 i;        for (i = 0; i < mNumNamespaces; i++) {          if (!namespaceURI.Equals(NS_ConvertASCIItoUCS2(mNamespaceArray[i]))) {            continue;          }        }      }            nsCOMPtr<nsIContent> content(do_QueryInterface(childElement));      NS_ASSERTION(content, "Element is not content");      if (!content) {        return NS_ERROR_FAILURE;      }            nsCOMPtr<nsINodeInfo> nodeInfo;      content->GetNodeInfo(*getter_AddRefs(nodeInfo));      if (!nodeInfo) {        return NS_ERROR_FAILURE;      }            nodeInfo->GetNameAtom(*aElementName);      *aChildElement = childElement;      NS_ADDREF(*aChildElement);      break;    }        return NS_OK;  }