nsIDocument* document = nsnull; aParent->GetDocument(document);
nsCOMPtr<nsIDocument> document; aParent->GetDocument(*getter_AddRefs(document));
nsresult NS_CreateAnonymousNode(nsIContent* aParent, nsIAtom* aTag, PRInt32 aNameSpaceId, nsCOMPtr<nsIContent>& aNewNode){    // get the document    nsIDocument* document = nsnull;    aParent->GetDocument(document);        // create the xml element    nsCOMPtr<nsIXMLContent> content;    //NS_NewXMLElement(getter_AddRefs(content), aTag);    content = new AnonymousElement(aTag);    content->SetNameSpaceID(aNameSpaceId);        // set the document    content->SetDocument(document, PR_TRUE);        aNewNode = content;  /*    nsCOMPtr<nsIDocument> document;    aParent->GetDocument(*getter_AddRefs(document));    nsCOMPtr<nsIDOMDocument> domDocument(do_QueryInterface(document));    nsCOMPtr<nsIDOMElement> element;    nsString name;    aTag->ToString(name);    domDocument->CreateElement(name, getter_AddRefs(element));    aNewNode = do_QueryInterface(element);*/    return NS_OK;}