PRBool isEmpty; text->IsOnlyWhitespace(&isEmpty); if (isEmpty) {
nsAutoString result; text->CopyText(result); result.StripWhitespace(); if (result.IsEmpty()) {
nsXBLService::StripWhitespaceNodes(nsIContent* aElement){  PRInt32 childCount;  aElement->ChildCount(childCount);  for (PRInt32 i = 0; i < childCount; i++) {    nsCOMPtr<nsIContent> child;    aElement->ChildAt(i, *getter_AddRefs(child));    nsCOMPtr<nsITextContent> text = do_QueryInterface(child);    if (text) {      PRBool isEmpty;      text->IsOnlyWhitespace(&isEmpty);      if (isEmpty) {        // This node contained nothing but whitespace.        // Remove it from the content model.        aElement->RemoveChildAt(i, PR_TRUE);        i--; // Decrement our count, since we just removed this child.        childCount--; // Also decrement our total count.      }    }    else StripWhitespaceNodes(child);  }  return NS_OK;}