NS_RELEASE(child);
MatchElementId(nsIContent *aContent, const nsAString& aId){  if (aContent->IsContentOfType(nsIContent::eHTML)) {    if (aContent->HasAttr(kNameSpaceID_None, nsHTMLAtoms::id)) {      nsAutoString value;      aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value);      if (aId.Equals(value)) {        return aContent;      }    }  }  else if (aContent->IsContentOfType(nsIContent::eELEMENT)) {    nsCOMPtr<nsIXMLContent> xmlContent = do_QueryInterface(aContent);        if (xmlContent) {      nsCOMPtr<nsIAtom> value;      if (NS_SUCCEEDED(xmlContent->GetID(*getter_AddRefs(value))) &&          value && value->Equals(aId)) {        return aContent;      }    }  }    nsIContent *result = nsnull;  PRInt32 i, count;  aContent->ChildCount(count);  for (i = 0; i < count && result == nsnull; i++) {    nsIContent *child;    aContent->ChildAt(i, child);    result = MatchElementId(child, aId);    NS_RELEASE(child);  }    return result;}