Variant c_SimpleXMLElement::t___get(Variant name) {
  Variant ret;
  if (m_is_attribute) {
    ret = m_attributes[name];
  } else {
    ret = m_children[name];
    if (ret.isArray()) {
      ret = ret[0];
    }
  }
  if (ret.isObject()) {
    c_SimpleXMLElement *elem = ret.toObject().getTyped<c_SimpleXMLElement>();
    Object obj = create_object(m_doc.getTyped<XmlDocWrapper>()->
                               getClass(), Array(), false);
    c_SimpleXMLElement *e = obj.getTyped<c_SimpleXMLElement>();
    e->m_root = elem->m_root;
    e->m_doc = elem->m_doc;
    e->m_node = elem->m_node;
    e->m_children.assignRef(elem->m_children);
    e->m_attributes.assignRef(elem->m_attributes);
    e->m_is_text = elem->m_is_text;
    e->m_is_property = true;
    return obj;
  }
  if (ret.isNull()) {
    return create_object(o_getClassName(), Array(), false);
  }
  return ret;
}
Variant c_SimpleXMLElement::t___get(Variant name) {
  Variant ret;
  if (m_is_attribute) {
    ret = m_attributes[name];
  } else {
    ret = m_children[name];
    if (ret.isArray()) {
      ret = ret[0];
    }
  }
  if (ret.isObject()) {
    c_SimpleXMLElement *elem = ret.toObject().getTyped<c_SimpleXMLElement>();
    Object obj = create_object(m_doc.getTyped<XmlDocWrapper>()->
                               getClass(), Array(), false);
    c_SimpleXMLElement *e = obj.getTyped<c_SimpleXMLElement>();
    e->m_root = elem->m_root;
    e->m_doc = elem->m_doc;
    e->m_node = elem->m_node;
    e->m_children.assignRef(elem->m_children);
    e->m_attributes.assignRef(elem->m_attributes);
    e->m_is_text = elem->m_is_text;
    e->m_is_property = true;
    return obj;
  }
  if (ret.isNull()) {
    return create_object(o_getClassName(), Array(), false);
  }
  return ret;
}