static Object find_node(CVarRef children, xmlNodePtr node) {
  for (ArrayIter iter(children.toArray()); iter; ++iter) {
    if (iter.second().isObject()) {
      c_SimpleXMLElement *elem =
        iter.second().toObject().getTyped<c_SimpleXMLElement>();
      Object ret = elem->m_node == node ? elem
                                        : find_node(elem->m_children, node);
      if (!ret.isNull()) return ret;
    } else if(iter.second().isArray()) {
      Object ret = find_node(iter.second(), node);
      if (!ret.isNull()) return ret;
    }
  }
  return nullptr;
}
static Object find_node(CVarRef children, xmlNodePtr node) {
  for (ArrayIter iter(children.toArray()); iter; ++iter) {
    if (iter.second().isObject()) {
      c_SimpleXMLElement *elem =
        iter.second().toObject().getTyped<c_SimpleXMLElement>();
      Object ret = elem->m_node == node ? elem
                                        : find_node(elem->m_children, node);
      if (!ret.isNull()) return ret;
    } else if(iter.second().isArray()) {
      Object ret = find_node(iter.second(), node);
      if (!ret.isNull()) return ret;
    }
  }
  return nullptr;
}