+ /* If the document is just comments, then this should get us the
+ nodes anyway. */
+ xmlNode *n = doc->children->next;
+ Lisp_Object r = Qnil;
+
+ while (n) {
+ if (!NILP (r))
+ result = Fcons (r, result);
+ r = make_dom (n);
+ n = n->next;
+ }
+
+ if (NILP (result)) {
+ /* The document isn't just comments, so get the tree the
+ proper way. */
+ xmlNode *node = xmlDocGetRootElement (doc);
+ if (node != NULL)
+ result = make_dom (node);
+ } else
+ result = Fcons (intern ("top"),
+ Fcons (Qnil, Fnreverse (Fcons (r, result))));
+