if (NS_FAILED(rv = EnsureChildrenElement(parent, children)))
if (NS_FAILED(rv = EnsureChildElement(parent, kChildrenTag, children)))
RDFTreeDocumentImpl::AddTreeChild(nsIRDFContent* parent,                                  nsIRDFNode* property,                                  nsIRDFNode* value){    // If it's a tree property, then we need to add the new child    // element to a special "children" element in the parent.  The    // child element's value will be the value of the    // property. We'll also attach an "ID=" attribute to the new    // child; e.g.,    //    // <parent>    //   ...    //   <children>    //     <item id="value">    //        <!-- recursively generated -->    //     </item>    //   </children>    //   ...    // </parent>    nsresult rv;    nsIRDFContent* child = nsnull;    nsIContent* children = nsnull;    nsAutoString s;    // Ensure that the <children> element exists on the parent.    if (NS_FAILED(rv = EnsureChildrenElement(parent, children)))        goto done;    // Create a new child that represents the "value"    // resource. PR_TRUE indicates that we want the child to    // dynamically generate its own kids.    if (NS_FAILED(rv = NewChild(kFolderTag, value, child, PR_TRUE)))        goto done;    if (NS_FAILED(rv = value->GetStringValue(s)))        goto done;    if (NS_FAILED(rv = child->SetAttribute("ID", s, PR_FALSE)))        goto done;#define ALL_NODES_OPEN_HACK#ifdef ALL_NODES_OPEN_HACK    if (NS_FAILED(rv = child->SetAttribute("OPEN", "TRUE", PR_FALSE)))        goto done;#endif    // Finally, add the thing to the <children> element.    children->AppendChildTo(child, PR_TRUE);done:    NS_IF_RELEASE(child);    NS_IF_RELEASE(children);    return rv;}