/* TElement.c generated by valac 0.28.1, the Vala compiler
 * generated from TElement.vala, do not modify */

/* TElement.vala
 *
 * Copyright (C) 2015  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>
#include <libxml/xmlwriter.h>


#define GXML_TYPE_NODE (gxml_node_get_type ())
#define GXML_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE, GXmlNode))
#define GXML_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE))
#define GXML_NODE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NODE, GXmlNodeIface))

typedef struct _GXmlNode GXmlNode;
typedef struct _GXmlNodeIface GXmlNodeIface;

#define GXML_TYPE_ELEMENT_LIST (gxml_element_list_get_type ())
#define GXML_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementList))
#define GXML_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))
#define GXML_IS_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ELEMENT_LIST))
#define GXML_IS_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ELEMENT_LIST))
#define GXML_ELEMENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))

typedef struct _GXmlElementList GXmlElementList;
typedef struct _GXmlElementListClass GXmlElementListClass;

#define GXML_TYPE_NAMESPACE (gxml_namespace_get_type ())
#define GXML_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE, GXmlNamespace))
#define GXML_IS_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE))
#define GXML_NAMESPACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NAMESPACE, GXmlNamespaceIface))

typedef struct _GXmlNamespace GXmlNamespace;
typedef struct _GXmlNamespaceIface GXmlNamespaceIface;

#define GXML_TYPE_NODE_TYPE (gxml_node_type_get_type ())

#define GXML_TYPE_DOCUMENT (gxml_document_get_type ())
#define GXML_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_DOCUMENT, GXmlDocument))
#define GXML_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_DOCUMENT))
#define GXML_DOCUMENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_DOCUMENT, GXmlDocumentIface))

typedef struct _GXmlDocument GXmlDocument;
typedef struct _GXmlDocumentIface GXmlDocumentIface;

#define GXML_TYPE_TNODE (gxml_tnode_get_type ())
#define GXML_TNODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TNODE, GXmlTNode))
#define GXML_TNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TNODE, GXmlTNodeClass))
#define GXML_IS_TNODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TNODE))
#define GXML_IS_TNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TNODE))
#define GXML_TNODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TNODE, GXmlTNodeClass))

typedef struct _GXmlTNode GXmlTNode;
typedef struct _GXmlTNodeClass GXmlTNodeClass;
typedef struct _GXmlTNodePrivate GXmlTNodePrivate;

#define GXML_TYPE_ELEMENT (gxml_element_get_type ())
#define GXML_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ELEMENT, GXmlElement))
#define GXML_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ELEMENT))
#define GXML_ELEMENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_ELEMENT, GXmlElementIface))

typedef struct _GXmlElement GXmlElement;
typedef struct _GXmlElementIface GXmlElementIface;

#define GXML_TYPE_TELEMENT (gxml_telement_get_type ())
#define GXML_TELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TELEMENT, GXmlTElement))
#define GXML_TELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TELEMENT, GXmlTElementClass))
#define GXML_IS_TELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TELEMENT))
#define GXML_IS_TELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TELEMENT))
#define GXML_TELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TELEMENT, GXmlTElementClass))

typedef struct _GXmlTElement GXmlTElement;
typedef struct _GXmlTElementClass GXmlTElementClass;
typedef struct _GXmlTElementPrivate GXmlTElementPrivate;

#define GXML_TNODE_TYPE_TCHILDREN_LIST (gxml_tnode_tchildren_list_get_type ())
#define GXML_TNODE_TCHILDREN_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TNODE_TYPE_TCHILDREN_LIST, GXmlTNodeTChildrenList))
#define GXML_TNODE_TCHILDREN_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TNODE_TYPE_TCHILDREN_LIST, GXmlTNodeTChildrenListClass))
#define GXML_TNODE_IS_TCHILDREN_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TNODE_TYPE_TCHILDREN_LIST))
#define GXML_TNODE_IS_TCHILDREN_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TNODE_TYPE_TCHILDREN_LIST))
#define GXML_TNODE_TCHILDREN_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TNODE_TYPE_TCHILDREN_LIST, GXmlTNodeTChildrenListClass))

typedef struct _GXmlTNodeTChildrenList GXmlTNodeTChildrenList;
typedef struct _GXmlTNodeTChildrenListClass GXmlTNodeTChildrenListClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GXML_TYPE_TDOCUMENT (gxml_tdocument_get_type ())
#define GXML_TDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TDOCUMENT, GXmlTDocument))
#define GXML_TDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TDOCUMENT, GXmlTDocumentClass))
#define GXML_IS_TDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TDOCUMENT))
#define GXML_IS_TDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TDOCUMENT))
#define GXML_TDOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TDOCUMENT, GXmlTDocumentClass))

typedef struct _GXmlTDocument GXmlTDocument;
typedef struct _GXmlTDocumentClass GXmlTDocumentClass;

#define GXML_TYPE_TATTRIBUTE (gxml_tattribute_get_type ())
#define GXML_TATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TATTRIBUTE, GXmlTAttribute))
#define GXML_TATTRIBUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TATTRIBUTE, GXmlTAttributeClass))
#define GXML_IS_TATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TATTRIBUTE))
#define GXML_IS_TATTRIBUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TATTRIBUTE))
#define GXML_TATTRIBUTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TATTRIBUTE, GXmlTAttributeClass))

typedef struct _GXmlTAttribute GXmlTAttribute;
typedef struct _GXmlTAttributeClass GXmlTAttributeClass;

#define GXML_TYPE_ATTRIBUTE (gxml_attribute_get_type ())
#define GXML_ATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ATTRIBUTE, GXmlAttribute))
#define GXML_IS_ATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ATTRIBUTE))
#define GXML_ATTRIBUTE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_ATTRIBUTE, GXmlAttributeIface))

typedef struct _GXmlAttribute GXmlAttribute;
typedef struct _GXmlAttributeIface GXmlAttributeIface;

#define GXML_TYPE_TEXT (gxml_text_get_type ())
#define GXML_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TEXT, GXmlText))
#define GXML_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TEXT))
#define GXML_TEXT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_TEXT, GXmlTextIface))

typedef struct _GXmlText GXmlText;
typedef struct _GXmlTextIface GXmlTextIface;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GXmlNamespaceIface {
	GTypeInterface parent_iface;
	gchar* (*get_uri) (GXmlNamespace* self);
	gchar* (*get_prefix) (GXmlNamespace* self);
};

typedef enum  {
	GXML_NODE_TYPE_X_UNKNOWN = 0,
	GXML_NODE_TYPE_ELEMENT = 1,
	GXML_NODE_TYPE_ATTRIBUTE,
	GXML_NODE_TYPE_TEXT,
	GXML_NODE_TYPE_CDATA_SECTION,
	GXML_NODE_TYPE_ENTITY_REFERENCE,
	GXML_NODE_TYPE_ENTITY,
	GXML_NODE_TYPE_PROCESSING_INSTRUCTION,
	GXML_NODE_TYPE_COMMENT,
	GXML_NODE_TYPE_DOCUMENT,
	GXML_NODE_TYPE_DOCUMENT_TYPE,
	GXML_NODE_TYPE_DOCUMENT_FRAGMENT,
	GXML_NODE_TYPE_NOTATION
} GXmlNodeType;

struct _GXmlDocumentIface {
	GTypeInterface parent_iface;
	GXmlNode* (*create_element) (GXmlDocument* self, const gchar* name, GError** error);
	GXmlNode* (*create_text) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_comment) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_cdata) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_pi) (GXmlDocument* self, const gchar* target, const gchar* data);
	gboolean (*save) (GXmlDocument* self, GCancellable* cancellable, GError** error);
	gboolean (*save_as) (GXmlDocument* self, GFile* f, GCancellable* cancellable, GError** error);
	gboolean (*get_indent) (GXmlDocument* self);
	void (*set_indent) (GXmlDocument* self, gboolean value);
	gboolean (*get_ns_top) (GXmlDocument* self);
	void (*set_ns_top) (GXmlDocument* self, gboolean value);
	gboolean (*get_prefix_default_ns) (GXmlDocument* self);
	void (*set_prefix_default_ns) (GXmlDocument* self, gboolean value);
	gboolean (*get_backup) (GXmlDocument* self);
	void (*set_backup) (GXmlDocument* self, gboolean value);
	GXmlNode* (*get_root) (GXmlDocument* self);
	GFile* (*get_file) (GXmlDocument* self);
	void (*set_file) (GXmlDocument* self, GFile* value);
};

struct _GXmlNodeIface {
	GTypeInterface parent_iface;
	GXmlNode* (*get) (GXmlNode* self, const gchar* key);
	GXmlElementList* (*get_elements_by_property_value) (GXmlNode* self, const gchar* property, const gchar* value);
	gchar* (*to_string) (GXmlNode* self);
	gboolean (*set_namespace) (GXmlNode* self, const gchar* uri, const gchar* prefix);
	gchar* (*ns_prefix) (GXmlNode* self);
	gchar* (*ns_uri) (GXmlNode* self);
	GeeList* (*get_namespaces) (GXmlNode* self);
	GeeBidirList* (*get_childs) (GXmlNode* self);
	GeeBidirList* (*get_children) (GXmlNode* self);
	GeeMap* (*get_attrs) (GXmlNode* self);
	gchar* (*get_name) (GXmlNode* self);
	gchar* (*get_value) (GXmlNode* self);
	void (*set_value) (GXmlNode* self, const gchar* value);
	GXmlNodeType (*get_type_node) (GXmlNode* self);
	GXmlDocument* (*get_document) (GXmlNode* self);
	GXmlNode* (*get_parent) (GXmlNode* self);
};

struct _GXmlTNode {
	GObject parent_instance;
	GXmlTNodePrivate * priv;
	gchar* _name;
	gchar* _value;
	GXmlDocument* _doc;
	GXmlNode* _parent;
	xmlTextWriter* tw;
};

struct _GXmlTNodeClass {
	GObjectClass parent_class;
	gboolean (*set_namespace) (GXmlTNode* self, const gchar* uri, const gchar* prefix);
	gchar* (*to_string) (GXmlTNode* self);
	void (*set_parent) (GXmlTNode* self, GXmlNode* node);
	GeeMap* (*get_attrs) (GXmlTNode* self);
	GeeBidirList* (*get_children) (GXmlTNode* self);
	GXmlDocument* (*get_document) (GXmlTNode* self);
	gchar* (*get_name) (GXmlTNode* self);
	GeeList* (*get_namespaces) (GXmlTNode* self);
	GXmlNodeType (*get_type_node) (GXmlTNode* self);
	gchar* (*get_value) (GXmlTNode* self);
	void (*set_value) (GXmlTNode* self, const gchar* value);
	GXmlNode* (*get_parent) (GXmlTNode* self);
};

struct _GXmlElementIface {
	GTypeInterface parent_iface;
	void (*normalize) (GXmlElement* self);
	void (*set_attr) (GXmlElement* self, const gchar* name, const gchar* value);
	GXmlNode* (*get_attr) (GXmlElement* self, const gchar* name);
	void (*remove_attr) (GXmlElement* self, const gchar* name);
	void (*set_ns_attr) (GXmlElement* self, GXmlNamespace* ns, const gchar* name, const gchar* value);
	GXmlNode* (*get_ns_attr) (GXmlElement* self, const gchar* name, const gchar* uri);
	gchar* (*get_tag_name) (GXmlElement* self);
	gchar* (*get_content) (GXmlElement* self);
	void (*set_content) (GXmlElement* self, const gchar* value);
};

struct _GXmlTElement {
	GXmlTNode parent_instance;
	GXmlTElementPrivate * priv;
	GeeHashMap* _attrs;
	GXmlTNodeTChildrenList* _children;
	GeeArrayList* _namespaces;
};

struct _GXmlTElementClass {
	GXmlTNodeClass parent_class;
};

struct _GXmlTElementPrivate {
	gchar* _content;
};

struct _GXmlAttributeIface {
	GTypeInterface parent_iface;
	GXmlNamespace* (*get_namespace) (GXmlAttribute* self);
	void (*set_namespace) (GXmlAttribute* self, GXmlNamespace* value);
	gchar* (*get_prefix) (GXmlAttribute* self);
};

struct _GXmlTextIface {
	GTypeInterface parent_iface;
	gchar* (*get_str) (GXmlText* self);
};


static gpointer gxml_telement_parent_class = NULL;
static GXmlElementIface* gxml_telement_gxml_element_parent_iface = NULL;

GType gxml_element_list_get_type (void) G_GNUC_CONST;
GType gxml_namespace_get_type (void) G_GNUC_CONST;
GType gxml_node_type_get_type (void) G_GNUC_CONST;
GType gxml_document_get_type (void) G_GNUC_CONST;
GType gxml_node_get_type (void) G_GNUC_CONST;
GType gxml_tnode_get_type (void) G_GNUC_CONST;
GType gxml_element_get_type (void) G_GNUC_CONST;
GType gxml_telement_get_type (void) G_GNUC_CONST;
GType gxml_tnode_tchildren_list_get_type (void) G_GNUC_CONST;
#define GXML_TELEMENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GXML_TYPE_TELEMENT, GXmlTElementPrivate))
enum  {
	GXML_TELEMENT_DUMMY_PROPERTY,
	GXML_TELEMENT_VALUE,
	GXML_TELEMENT_ATTRS,
	GXML_TELEMENT_CHILDREN,
	GXML_TELEMENT_NAMESPACES,
	GXML_TELEMENT_CONTENT,
	GXML_TELEMENT_TAG_NAME
};
GXmlTElement* gxml_telement_new (GXmlDocument* d, const gchar* name);
GXmlTElement* gxml_telement_construct (GType object_type, GXmlDocument* d, const gchar* name);
GType gxml_tdocument_get_type (void) G_GNUC_CONST;
GXmlTNode* gxml_tnode_construct (GType object_type);
static void gxml_telement_real_set_attr (GXmlElement* base, const gchar* name, const gchar* value);
GType gxml_tattribute_get_type (void) G_GNUC_CONST;
GXmlDocument* gxml_tnode_get_document (GXmlTNode* self);
GXmlTAttribute* gxml_tattribute_new (GXmlDocument* d, const gchar* name, const gchar* value);
GXmlTAttribute* gxml_tattribute_construct (GType object_type, GXmlDocument* d, const gchar* name, const gchar* value);
void gxml_tnode_set_parent (GXmlTNode* self, GXmlNode* node);
GeeMap* gxml_tnode_get_attrs (GXmlTNode* self);
static GXmlNode* gxml_telement_real_get_attr (GXmlElement* base, const gchar* name);
static GXmlNode* gxml_telement_real_get_ns_attr (GXmlElement* base, const gchar* name, const gchar* uri);
gchar* gxml_node_get_name (GXmlNode* self);
GType gxml_attribute_get_type (void) G_GNUC_CONST;
GXmlNamespace* gxml_attribute_get_namespace (GXmlAttribute* self);
gchar* gxml_namespace_get_uri (GXmlNamespace* self);
static void gxml_telement_real_set_ns_attr (GXmlElement* base, GXmlNamespace* ns, const gchar* name, const gchar* value);
gboolean gxml_tnode_set_namespace (GXmlTNode* self, const gchar* uri, const gchar* prefix);
gchar* gxml_namespace_get_prefix (GXmlNamespace* self);
static void gxml_telement_real_remove_attr (GXmlElement* base, const gchar* name);
static void gxml_telement_real_normalize (GXmlElement* base);
static void gxml_telement_calculate_content (GXmlTElement* self);
GeeBidirList* gxml_node_get_childs (GXmlNode* self);
GType gxml_text_get_type (void) G_GNUC_CONST;
gchar* gxml_node_get_value (GXmlNode* self);
static void gxml_telement_update_content (GXmlTElement* self, const gchar* val);
GXmlNode* gxml_document_create_text (GXmlDocument* self, const gchar* text);
GXmlTNodeTChildrenList* gxml_tnode_tchildren_list_new (GXmlNode* e);
GXmlTNodeTChildrenList* gxml_tnode_tchildren_list_construct (GType object_type, GXmlNode* e);
gchar* gxml_tnode_get_name (GXmlTNode* self);
static void gxml_telement_finalize (GObject* obj);
gchar* gxml_tnode_get_value (GXmlTNode* self);
GeeBidirList* gxml_tnode_get_children (GXmlTNode* self);
GeeList* gxml_tnode_get_namespaces (GXmlTNode* self);
gchar* gxml_element_get_content (GXmlElement* self);
gchar* gxml_element_get_tag_name (GXmlElement* self);
static void _vala_gxml_telement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void gxml_tnode_set_value (GXmlTNode* self, const gchar* value);
void gxml_element_set_content (GXmlElement* self, const gchar* value);
static void _vala_gxml_telement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


GXmlTElement* gxml_telement_construct (GType object_type, GXmlDocument* d, const gchar* name) {
	GXmlTElement * self = NULL;
	GXmlDocument* _tmp0_ = NULL;
	GXmlDocument* _tmp1_ = NULL;
	GXmlDocument* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (d != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = d;
	_vala_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GXML_TYPE_TDOCUMENT), "d is TDocument", NULL);
	self = (GXmlTElement*) gxml_tnode_construct (object_type);
	_tmp1_ = d;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (((GXmlTNode*) self)->_doc);
	((GXmlTNode*) self)->_doc = _tmp2_;
	_tmp3_ = name;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (((GXmlTNode*) self)->_name);
	((GXmlTNode*) self)->_name = _tmp4_;
	return self;
}


GXmlTElement* gxml_telement_new (GXmlDocument* d, const gchar* name) {
	return gxml_telement_construct (GXML_TYPE_TELEMENT, d, name);
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = needle;
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
	result = _tmp1_ != NULL;
	return result;
}


static void gxml_telement_real_set_attr (GXmlElement* base, const gchar* name, const gchar* value) {
	GXmlTElement * self;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	GXmlTAttribute* att = NULL;
	GXmlDocument* _tmp2_ = NULL;
	GXmlDocument* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	GXmlTAttribute* _tmp6_ = NULL;
	GXmlTAttribute* _tmp7_ = NULL;
	GeeMap* _tmp8_ = NULL;
	GeeMap* _tmp9_ = NULL;
	GeeMap* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	GXmlTAttribute* _tmp12_ = NULL;
	self = (GXmlTElement*) base;
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = name;
	_tmp1_ = string_contains (_tmp0_, ":");
	if (_tmp1_) {
		return;
	}
	_tmp2_ = gxml_tnode_get_document ((GXmlTNode*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = name;
	_tmp5_ = value;
	_tmp6_ = gxml_tattribute_new (_tmp3_, _tmp4_, _tmp5_);
	att = _tmp6_;
	_tmp7_ = att;
	gxml_tnode_set_parent ((GXmlTNode*) _tmp7_, (GXmlNode*) self);
	_tmp8_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = name;
	_tmp12_ = att;
	gee_map_set (_tmp10_, _tmp11_, (GXmlNode*) _tmp12_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (att);
}


static GXmlNode* gxml_telement_real_get_attr (GXmlElement* base, const gchar* name) {
	GXmlTElement * self;
	GXmlNode* result = NULL;
	GeeMap* _tmp0_ = NULL;
	GeeMap* _tmp1_ = NULL;
	GeeMap* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gpointer _tmp4_ = NULL;
	GXmlNode* _tmp5_ = NULL;
	self = (GXmlTElement*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = name;
	_tmp4_ = gee_map_get (_tmp2_, _tmp3_);
	_tmp5_ = (GXmlNode*) _tmp4_;
	_g_object_unref0 (_tmp2_);
	result = _tmp5_;
	return result;
}


static GXmlNode* gxml_telement_real_get_ns_attr (GXmlElement* base, const gchar* name, const gchar* uri) {
	GXmlTElement * self;
	GXmlNode* result = NULL;
	self = (GXmlTElement*) base;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (uri != NULL, NULL);
	{
		GeeIterator* _a_it = NULL;
		GeeMap* _tmp0_ = NULL;
		GeeMap* _tmp1_ = NULL;
		GeeMap* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeCollection* _tmp4_ = NULL;
		GeeCollection* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
		_tmp0_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_map_get_values (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_g_object_unref0 (_tmp2_);
		_a_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			GXmlNode* a = NULL;
			GeeIterator* _tmp10_ = NULL;
			gpointer _tmp11_ = NULL;
			GXmlNode* _tmp12_ = NULL;
			gchar* _tmp13_ = NULL;
			gchar* _tmp14_ = NULL;
			gchar* _tmp15_ = NULL;
			const gchar* _tmp16_ = NULL;
			gboolean _tmp17_ = FALSE;
			_tmp8_ = _a_it;
			_tmp9_ = gee_iterator_next (_tmp8_);
			if (!_tmp9_) {
				break;
			}
			_tmp10_ = _a_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			a = (GXmlNode*) _tmp11_;
			_tmp12_ = a;
			_tmp13_ = gxml_node_get_name (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = _tmp14_;
			_tmp16_ = name;
			_tmp17_ = g_strcmp0 (_tmp15_, _tmp16_) == 0;
			_g_free0 (_tmp15_);
			if (_tmp17_) {
				GXmlNode* _tmp18_ = NULL;
				GXmlNamespace* _tmp19_ = NULL;
				GXmlNamespace* _tmp20_ = NULL;
				GXmlNamespace* _tmp21_ = NULL;
				gboolean _tmp22_ = FALSE;
				_tmp18_ = a;
				_tmp19_ = gxml_attribute_get_namespace (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GXML_TYPE_ATTRIBUTE, GXmlAttribute));
				_tmp20_ = _tmp19_;
				_tmp21_ = _tmp20_;
				_tmp22_ = _tmp21_ != NULL;
				_g_object_unref0 (_tmp21_);
				if (_tmp22_) {
					GXmlNode* _tmp23_ = NULL;
					GXmlNamespace* _tmp24_ = NULL;
					GXmlNamespace* _tmp25_ = NULL;
					GXmlNamespace* _tmp26_ = NULL;
					gchar* _tmp27_ = NULL;
					gchar* _tmp28_ = NULL;
					gchar* _tmp29_ = NULL;
					const gchar* _tmp30_ = NULL;
					gboolean _tmp31_ = FALSE;
					_tmp23_ = a;
					_tmp24_ = gxml_attribute_get_namespace (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GXML_TYPE_ATTRIBUTE, GXmlAttribute));
					_tmp25_ = _tmp24_;
					_tmp26_ = _tmp25_;
					_tmp27_ = gxml_namespace_get_uri (_tmp26_);
					_tmp28_ = _tmp27_;
					_tmp29_ = _tmp28_;
					_tmp30_ = uri;
					_tmp31_ = g_strcmp0 (_tmp29_, _tmp30_) == 0;
					_g_free0 (_tmp29_);
					_g_object_unref0 (_tmp26_);
					if (_tmp31_) {
						GXmlNode* _tmp32_ = NULL;
						GXmlNode* _tmp33_ = NULL;
						_tmp32_ = a;
						_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GXML_TYPE_NODE, GXmlNode));
						result = _tmp33_;
						_g_object_unref0 (a);
						_g_object_unref0 (_a_it);
						return result;
					}
				}
			}
			_g_object_unref0 (a);
		}
		_g_object_unref0 (_a_it);
	}
	result = NULL;
	return result;
}


static void gxml_telement_real_set_ns_attr (GXmlElement* base, GXmlNamespace* ns, const gchar* name, const gchar* value) {
	GXmlTElement * self;
	GXmlTAttribute* att = NULL;
	GXmlDocument* _tmp0_ = NULL;
	GXmlDocument* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GXmlTAttribute* _tmp4_ = NULL;
	GXmlNamespace* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	GXmlNamespace* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	GeeMap* _tmp13_ = NULL;
	GeeMap* _tmp14_ = NULL;
	GeeMap* _tmp15_ = NULL;
	GXmlNamespace* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	self = (GXmlTElement*) base;
	g_return_if_fail (ns != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = gxml_tnode_get_document ((GXmlTNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = name;
	_tmp3_ = value;
	_tmp4_ = gxml_tattribute_new (_tmp1_, _tmp2_, _tmp3_);
	att = _tmp4_;
	_tmp5_ = ns;
	_tmp6_ = gxml_namespace_get_uri (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = ns;
	_tmp10_ = gxml_namespace_get_prefix (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_;
	gxml_tnode_set_namespace ((GXmlTNode*) att, _tmp8_, _tmp12_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp8_);
	gxml_tnode_set_parent ((GXmlTNode*) att, (GXmlNode*) self);
	_tmp13_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp16_ = ns;
	_tmp17_ = gxml_namespace_get_prefix (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_;
	_tmp20_ = g_strconcat (_tmp19_, ":", NULL);
	_tmp21_ = _tmp20_;
	_tmp22_ = name;
	_tmp23_ = g_strconcat (_tmp21_, _tmp22_, NULL);
	_tmp24_ = _tmp23_;
	gee_map_set (_tmp15_, _tmp24_, (GXmlNode*) att);
	_g_free0 (_tmp24_);
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (att);
}


static void gxml_telement_real_remove_attr (GXmlElement* base, const gchar* name) {
	GXmlTElement * self;
	GeeMap* _tmp0_ = NULL;
	GeeMap* _tmp1_ = NULL;
	GeeMap* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	self = (GXmlTElement*) base;
	g_return_if_fail (name != NULL);
	_tmp0_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = name;
	_tmp4_ = gee_map_has_key (_tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	if (_tmp5_) {
		GeeMap* _tmp6_ = NULL;
		GeeMap* _tmp7_ = NULL;
		GeeMap* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		_tmp6_ = gxml_tnode_get_attrs ((GXmlTNode*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = name;
		gee_map_unset (_tmp8_, _tmp9_, NULL);
		_g_object_unref0 (_tmp8_);
	}
}


static void gxml_telement_real_normalize (GXmlElement* base) {
	GXmlTElement * self;
	self = (GXmlTElement*) base;
}


static void gxml_telement_calculate_content (GXmlTElement* self) {
	gchar* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	_g_free0 (self->priv->_content);
	self->priv->_content = _tmp0_;
	{
		GeeBidirList* _n_list = NULL;
		GeeBidirList* _tmp1_ = NULL;
		GeeBidirList* _tmp2_ = NULL;
		gint _n_size = 0;
		GeeBidirList* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _n_index = 0;
		_tmp1_ = gxml_node_get_childs ((GXmlNode*) self);
		_tmp2_ = _tmp1_;
		_n_list = _tmp2_;
		_tmp3_ = _n_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_n_size = _tmp5_;
		_n_index = -1;
		while (TRUE) {
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			gint _tmp8_ = 0;
			GXmlNode* n = NULL;
			GeeBidirList* _tmp9_ = NULL;
			gint _tmp10_ = 0;
			gpointer _tmp11_ = NULL;
			GXmlNode* _tmp12_ = NULL;
			_tmp6_ = _n_index;
			_n_index = _tmp6_ + 1;
			_tmp7_ = _n_index;
			_tmp8_ = _n_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _n_list;
			_tmp10_ = _n_index;
			_tmp11_ = gee_list_get ((GeeList*) _tmp9_, _tmp10_);
			n = (GXmlNode*) _tmp11_;
			_tmp12_ = n;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GXML_TYPE_TEXT)) {
				const gchar* _tmp13_ = NULL;
				GXmlNode* _tmp14_ = NULL;
				gchar* _tmp15_ = NULL;
				gchar* _tmp16_ = NULL;
				gchar* _tmp17_ = NULL;
				gchar* _tmp18_ = NULL;
				_tmp13_ = self->priv->_content;
				_tmp14_ = n;
				_tmp15_ = gxml_node_get_value (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = _tmp16_;
				_tmp18_ = g_strconcat (_tmp13_, _tmp17_, NULL);
				_g_free0 (self->priv->_content);
				self->priv->_content = _tmp18_;
				_g_free0 (_tmp17_);
			}
			_g_object_unref0 (n);
		}
		_g_object_unref0 (_n_list);
	}
}


static void gxml_telement_update_content (GXmlTElement* self, const gchar* val) {
	const gchar* _tmp22_ = NULL;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gint _tmp2_ = 0;
				GeeBidirList* _tmp3_ = NULL;
				GeeBidirList* _tmp4_ = NULL;
				GeeBidirList* _tmp5_ = NULL;
				gint _tmp6_ = 0;
				gint _tmp7_ = 0;
				gboolean _tmp8_ = FALSE;
				GXmlNode* n = NULL;
				GeeBidirList* _tmp9_ = NULL;
				GeeBidirList* _tmp10_ = NULL;
				GeeBidirList* _tmp11_ = NULL;
				gint _tmp12_ = 0;
				gpointer _tmp13_ = NULL;
				GXmlNode* _tmp14_ = NULL;
				GXmlNode* _tmp15_ = NULL;
				if (!_tmp0_) {
					gint _tmp1_ = 0;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = i;
				_tmp3_ = gxml_node_get_childs ((GXmlNode*) self);
				_tmp4_ = _tmp3_;
				_tmp5_ = _tmp4_;
				_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = !(_tmp2_ < _tmp7_);
				_g_object_unref0 (_tmp5_);
				if (_tmp8_) {
					break;
				}
				_tmp9_ = gxml_node_get_childs ((GXmlNode*) self);
				_tmp10_ = _tmp9_;
				_tmp11_ = _tmp10_;
				_tmp12_ = i;
				_tmp13_ = gee_list_get ((GeeList*) _tmp11_, _tmp12_);
				_tmp14_ = (GXmlNode*) _tmp13_;
				_g_object_unref0 (_tmp11_);
				n = _tmp14_;
				_tmp15_ = n;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GXML_TYPE_TEXT)) {
					GeeBidirList* _tmp16_ = NULL;
					GeeBidirList* _tmp17_ = NULL;
					GeeBidirList* _tmp18_ = NULL;
					gint _tmp19_ = 0;
					gpointer _tmp20_ = NULL;
					GXmlNode* _tmp21_ = NULL;
					_tmp16_ = gxml_node_get_childs ((GXmlNode*) self);
					_tmp17_ = _tmp16_;
					_tmp18_ = _tmp17_;
					_tmp19_ = i;
					_tmp20_ = gee_list_remove_at ((GeeList*) _tmp18_, _tmp19_);
					_tmp21_ = (GXmlNode*) _tmp20_;
					_g_object_unref0 (_tmp21_);
					_g_object_unref0 (_tmp18_);
				}
				_g_object_unref0 (n);
			}
		}
	}
	_tmp22_ = val;
	if (_tmp22_ != NULL) {
		GXmlNode* t = NULL;
		GXmlDocument* _tmp23_ = NULL;
		GXmlDocument* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		GXmlNode* _tmp26_ = NULL;
		GeeBidirList* _tmp27_ = NULL;
		GeeBidirList* _tmp28_ = NULL;
		GeeBidirList* _tmp29_ = NULL;
		GXmlNode* _tmp30_ = NULL;
		_tmp23_ = gxml_tnode_get_document ((GXmlTNode*) self);
		_tmp24_ = _tmp23_;
		_tmp25_ = val;
		_tmp26_ = gxml_document_create_text (_tmp24_, _tmp25_);
		t = _tmp26_;
		_tmp27_ = gxml_node_get_childs ((GXmlNode*) self);
		_tmp28_ = _tmp27_;
		_tmp29_ = _tmp28_;
		_tmp30_ = t;
		gee_collection_add ((GeeCollection*) _tmp29_, _tmp30_);
		_g_object_unref0 (_tmp29_);
		_g_object_unref0 (t);
	}
}


static gchar* gxml_telement_real_get_value (GXmlTNode* base) {
	gchar* result;
	GXmlTElement* self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self = (GXmlTElement*) base;
	gxml_telement_calculate_content (self);
	_tmp0_ = self->priv->_content;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


static void gxml_telement_real_set_value (GXmlTNode* base, const gchar* value) {
	GXmlTElement* self;
	const gchar* _tmp0_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = value;
	gxml_telement_update_content (self, _tmp0_);
	g_object_notify ((GObject *) self, "value");
}


static GeeMap* gxml_telement_real_get_attrs (GXmlTNode* base) {
	GeeMap* result;
	GXmlTElement* self;
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GeeMap* _tmp4_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = self->_attrs;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_ = NULL;
		_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, GXML_TYPE_NODE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (self->_attrs);
		self->_attrs = _tmp1_;
	}
	_tmp2_ = self->_attrs;
	_tmp3_ = g_object_ref ((GObject*) _tmp2_);
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_MAP) ? ((GeeMap*) _tmp3_) : NULL);
	result = _tmp4_;
	return result;
}


static GeeBidirList* gxml_telement_real_get_children (GXmlTNode* base) {
	GeeBidirList* result;
	GXmlTElement* self;
	GXmlTNodeTChildrenList* _tmp0_ = NULL;
	GXmlTNodeTChildrenList* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GeeBidirList* _tmp4_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = self->_children;
	if (_tmp0_ == NULL) {
		GXmlTNodeTChildrenList* _tmp1_ = NULL;
		_tmp1_ = gxml_tnode_tchildren_list_new ((GXmlNode*) self);
		_g_object_unref0 (self->_children);
		self->_children = _tmp1_;
	}
	_tmp2_ = self->_children;
	_tmp3_ = g_object_ref ((GObject*) _tmp2_);
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_BIDIR_LIST) ? ((GeeBidirList*) _tmp3_) : NULL);
	result = _tmp4_;
	return result;
}


static GeeList* gxml_telement_real_get_namespaces (GXmlTNode* base) {
	GeeList* result;
	GXmlTElement* self;
	GeeArrayList* _tmp0_ = NULL;
	GeeArrayList* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GeeList* _tmp4_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = self->_namespaces;
	if (_tmp0_ == NULL) {
		GeeArrayList* _tmp1_ = NULL;
		_tmp1_ = gee_array_list_new (GXML_TYPE_NODE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
		_g_object_unref0 (self->_namespaces);
		self->_namespaces = _tmp1_;
	}
	_tmp2_ = self->_namespaces;
	_tmp3_ = g_object_ref ((GObject*) _tmp2_);
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_LIST) ? ((GeeList*) _tmp3_) : NULL);
	result = _tmp4_;
	return result;
}


static gchar* gxml_telement_real_get_content (GXmlElement* base) {
	gchar* result;
	GXmlTElement* self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self = (GXmlTElement*) base;
	gxml_telement_calculate_content (self);
	_tmp0_ = self->priv->_content;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


static void gxml_telement_real_set_content (GXmlElement* base, const gchar* value) {
	GXmlTElement* self;
	const gchar* _tmp0_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = value;
	gxml_telement_update_content (self, _tmp0_);
	g_object_notify ((GObject *) self, "content");
}


static gchar* gxml_telement_real_get_tag_name (GXmlElement* base) {
	gchar* result;
	GXmlTElement* self;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self = (GXmlTElement*) base;
	_tmp0_ = gxml_tnode_get_name ((GXmlTNode*) self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}


static void gxml_telement_class_init (GXmlTElementClass * klass) {
	gxml_telement_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GXmlTElementPrivate));
	GXML_TNODE_CLASS (klass)->get_value = gxml_telement_real_get_value;
	GXML_TNODE_CLASS (klass)->set_value = gxml_telement_real_set_value;
	GXML_TNODE_CLASS (klass)->get_attrs = gxml_telement_real_get_attrs;
	GXML_TNODE_CLASS (klass)->get_children = gxml_telement_real_get_children;
	GXML_TNODE_CLASS (klass)->get_namespaces = gxml_telement_real_get_namespaces;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_telement_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_telement_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_telement_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_VALUE, g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_ATTRS, g_param_spec_object ("attrs", "attrs", "attrs", GEE_TYPE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_CHILDREN, g_param_spec_object ("children", "children", "children", GEE_TYPE_BIDIR_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_NAMESPACES, g_param_spec_object ("namespaces", "namespaces", "namespaces", GEE_TYPE_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_CONTENT, g_param_spec_string ("content", "content", "content", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TELEMENT_TAG_NAME, g_param_spec_string ("tag-name", "tag-name", "tag-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gxml_telement_gxml_element_interface_init (GXmlElementIface * iface) {
	gxml_telement_gxml_element_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_attr = (void (*)(GXmlElement*, const gchar*, const gchar*)) gxml_telement_real_set_attr;
	iface->get_attr = (GXmlNode* (*)(GXmlElement*, const gchar*)) gxml_telement_real_get_attr;
	iface->get_ns_attr = (GXmlNode* (*)(GXmlElement*, const gchar*, const gchar*)) gxml_telement_real_get_ns_attr;
	iface->set_ns_attr = (void (*)(GXmlElement*, GXmlNamespace*, const gchar*, const gchar*)) gxml_telement_real_set_ns_attr;
	iface->remove_attr = (void (*)(GXmlElement*, const gchar*)) gxml_telement_real_remove_attr;
	iface->normalize = (void (*)(GXmlElement*)) gxml_telement_real_normalize;
	iface->get_content = gxml_telement_real_get_content;
	iface->set_content = gxml_telement_real_set_content;
	iface->get_tag_name = gxml_telement_real_get_tag_name;
}


static void gxml_telement_instance_init (GXmlTElement * self) {
	self->priv = GXML_TELEMENT_GET_PRIVATE (self);
	self->priv->_content = NULL;
}


static void gxml_telement_finalize (GObject* obj) {
	GXmlTElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_TELEMENT, GXmlTElement);
	_g_object_unref0 (self->_attrs);
	_g_object_unref0 (self->_children);
	_g_object_unref0 (self->_namespaces);
	_g_free0 (self->priv->_content);
	G_OBJECT_CLASS (gxml_telement_parent_class)->finalize (obj);
}


/**
 * Class implemeting {@link GXml.Element} interface, not tied to libxml-2.0 library.
 */
GType gxml_telement_get_type (void) {
	static volatile gsize gxml_telement_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_telement_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlTElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_telement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlTElement), 0, (GInstanceInitFunc) gxml_telement_instance_init, NULL };
		static const GInterfaceInfo gxml_element_info = { (GInterfaceInitFunc) gxml_telement_gxml_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gxml_telement_type_id;
		gxml_telement_type_id = g_type_register_static (GXML_TYPE_TNODE, "GXmlTElement", &g_define_type_info, 0);
		g_type_add_interface_static (gxml_telement_type_id, GXML_TYPE_ELEMENT, &gxml_element_info);
		g_once_init_leave (&gxml_telement_type_id__volatile, gxml_telement_type_id);
	}
	return gxml_telement_type_id__volatile;
}


static void _vala_gxml_telement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GXmlTElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_TELEMENT, GXmlTElement);
	switch (property_id) {
		case GXML_TELEMENT_VALUE:
		g_value_take_string (value, gxml_tnode_get_value ((GXmlTNode*) self));
		break;
		case GXML_TELEMENT_ATTRS:
		g_value_take_object (value, gxml_tnode_get_attrs ((GXmlTNode*) self));
		break;
		case GXML_TELEMENT_CHILDREN:
		g_value_take_object (value, gxml_tnode_get_children ((GXmlTNode*) self));
		break;
		case GXML_TELEMENT_NAMESPACES:
		g_value_take_object (value, gxml_tnode_get_namespaces ((GXmlTNode*) self));
		break;
		case GXML_TELEMENT_CONTENT:
		g_value_take_string (value, gxml_element_get_content ((GXmlElement*) self));
		break;
		case GXML_TELEMENT_TAG_NAME:
		g_value_take_string (value, gxml_element_get_tag_name ((GXmlElement*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gxml_telement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GXmlTElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_TELEMENT, GXmlTElement);
	switch (property_id) {
		case GXML_TELEMENT_VALUE:
		gxml_tnode_set_value ((GXmlTNode*) self, g_value_get_string (value));
		break;
		case GXML_TELEMENT_CONTENT:
		gxml_element_set_content ((GXmlElement*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



