nsIDOMNode * FindDOMNode(nsIDOMNode * aNode, nsIContent * aContent)
static nsIDOMNode * FindDOMNode(nsIDOMNode * aNode, nsIContent * aContent)
nsIDOMNode * FindDOMNode(nsIDOMNode * aNode, nsIContent * aContent){  nsIContent* content;  nsresult rv = aNode->QueryInterface(kIContentIID,(void **)&content);  if (NS_OK == rv) {    if (content == aContent) {      return aNode;    }  }  PRBool hasChildren;  aNode->HasChildNodes(&hasChildren);  if (hasChildren) {    nsIDOMNode * childNode;    aNode->GetFirstChild(&childNode);    while (childNode != nsnull) {      nsIDOMNode * node = FindDOMNode(childNode, aContent);      if (node != nsnull) {        return node;      }      nsIDOMNode * oldChild = childNode;      oldChild->GetNextSibling(&childNode);      NS_RELEASE(oldChild);    }  }  return nsnull;}