mSelect->SetSelectedIndex(-1);
nsXFormsSelectElement::Refresh(){  nsCOMPtr<nsIDOMNode> childNode, nodeReturn;  while (NS_SUCCEEDED(mSelect->GetFirstChild(getter_AddRefs(childNode))) &&         childNode) {    mSelect->RemoveChild(childNode, getter_AddRefs(nodeReturn));  }  nsCOMPtr<nsIDOMNodeList> childNodes;  nsresult rv = mElement->GetChildNodes(getter_AddRefs(childNodes));  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIXFormsSelectChild> childItem;  nsCOMPtr<nsIArray> childContent;  PRUint32 childCount;  childNodes->GetLength(&childCount);  for (PRUint32 i = 0; i < childCount; ++i) {    childNodes->Item(i, getter_AddRefs(childNode));    childItem = do_QueryInterface(childNode);    if (!childItem)      continue;    childItem->GetAnonymousNodes(getter_AddRefs(childContent));    PRUint32 nodeCount;    childContent->GetLength(&nodeCount);    for (PRUint32 j = 0; j < nodeCount; ++j) {      childNode = do_QueryElementAt(childContent, j);      mSelect->AppendChild(childNode, getter_AddRefs(nodeReturn));    }  }  nsCOMPtr<nsIDOMNode> modelNode;  nsCOMPtr<nsIDOMElement> bindElement;  nsCOMPtr<nsIDOMXPathResult> result =    nsXFormsUtils::EvaluateNodeBinding(mElement,                                       nsXFormsUtils::ELEMENT_WITH_MODEL_ATTR,                                       NS_LITERAL_STRING("ref"),                                       EmptyString(),                                       nsIDOMXPathResult::FIRST_ORDERED_NODE_TYPE,                                       getter_AddRefs(modelNode),                                       getter_AddRefs(bindElement));  nsCOMPtr<nsIModelElementPrivate> model = do_QueryInterface(modelNode);  if (model) {    model->AddFormControl(this);    nsCOMPtr<nsIDOMNode> resultNode;    if (result)      result->GetSingleNodeValue(getter_AddRefs(resultNode));    if (!resultNode)      return NS_OK;    nsCOMPtr<nsIDOMNodeList> children;    resultNode->GetChildNodes(getter_AddRefs(children));    if (!children)      return NS_OK;    nsCOMPtr<nsIDOMNode> child;    PRUint32 childCount;    children->GetLength(&childCount);    for (PRUint32 i = 0; i < childCount; ++i) {      children->Item(i, getter_AddRefs(child));      PRUint16 nodeType;      child->GetNodeType(&nodeType);      switch (nodeType) {      case nsIDOMNode::TEXT_NODE:        {          nsAutoString nodeValue;          child->GetNodeValue(nodeValue);          SelectItemsInList(nodeValue);        }        break;      case nsIDOMNode::ELEMENT_NODE:        SelectCopiedItem(child);        break;      default:        break;      }    }  }  return NS_OK;}