static Array create_children(c_SimpleXMLElement *root,
                             CResRef doc, xmlNodePtr parent,
                             const String& ns, bool is_prefix) {
  Array properties = Array::Create();
  for (xmlNodePtr node = parent->children; node; node = node->next) {
    if (parent->parent && parent->parent->type == XML_DOCUMENT_NODE &&
        node->type == XML_COMMENT_NODE) continue;
    if (node->children || node->prev || node->next) {
      if (node->type == XML_TEXT_NODE) {
        // bad node from parser, ignoring it...
        continue;
      }
    } else {
      if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE) {
        if (node->content && *node->content && !xmlIsBlankNode(node)) {
          add_property
            (properties, parent,
             create_text(root, doc, node,
                         node_list_to_string(parent->doc, node),
                         ns, is_prefix, true));
        }
        continue;
      }
    }

    if (node->type != XML_ELEMENT_NODE || match_ns(node, ns, is_prefix)) {
      xmlNodePtr child = node->children;
      Object sub;
      if (child && (child->type == XML_TEXT_NODE ||
                    child->type == XML_CDATA_SECTION_NODE)
                && !xmlIsBlankNode(child)) {
        sub = create_text(root, doc, child,
                          node_list_to_string(parent->doc, child),
                          ns, is_prefix, false);
      } else {
        sub = create_element(root, doc, node, ns, is_prefix);
      }
      add_property(properties, node, sub);
    }
  }
  return properties;
}
static Array create_children(c_SimpleXMLElement *root,
                             CResRef doc, xmlNodePtr parent,
                             const String& ns, bool is_prefix) {
  Array properties = Array::Create();
  for (xmlNodePtr node = parent->children; node; node = node->next) {
    if (parent->parent && parent->parent->type == XML_DOCUMENT_NODE &&
        node->type == XML_COMMENT_NODE) continue;
    if (node->children || node->prev || node->next) {
      if (node->type == XML_TEXT_NODE) {
         
        continue;
      }
    } else {
      if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE) {
        if (node->content && *node->content && !xmlIsBlankNode(node)) {
          add_property
            (properties, parent,
             create_text(root, doc, node,
                         node_list_to_string(parent->doc, node),
                         ns, is_prefix, true));
        }
        continue;
      }
    }

    if (node->type != XML_ELEMENT_NODE || match_ns(node, ns, is_prefix)) {
      xmlNodePtr child = node->children;
      Object sub;
      if (child && (child->type == XML_TEXT_NODE ||
                    child->type == XML_CDATA_SECTION_NODE)
                && !xmlIsBlankNode(child)) {
        sub = create_text(root, doc, child,
                          node_list_to_string(parent->doc, child),
                          ns, is_prefix, false);
      } else {
        sub = create_element(root, doc, node, ns, is_prefix);
      }
      add_property(properties, node, sub);
    }
  }
  return properties;
}