function add_subtag($name, $attributes = 0) { $tag = new XMLTag($this); $tag->set_name($name); if (is_array($attributes)) { $tag->set_attributes($attributes); } $this->tags[] =& $tag; $this->curtag =& $tag; }