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

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/* libxml-Element.vala
 *
 * Copyright (C) 2011-2013  Richard Schwarting <aquarichy@gmail.com>
 * Copyright (C) 2011,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:
 *      Richard Schwarting <aquarichy@gmail.com>
 *      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/tree.h>
#include <libxml/parser.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_XNODE (gxml_xnode_get_type ())
#define GXML_XNODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE, GXmlxNode))
#define GXML_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XNODE, GXmlxNodeClass))
#define GXML_IS_XNODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE))
#define GXML_IS_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XNODE))
#define GXML_XNODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XNODE, GXmlxNodeClass))

typedef struct _GXmlxNode GXmlxNode;
typedef struct _GXmlxNodeClass GXmlxNodeClass;
typedef struct _GXmlxNodePrivate GXmlxNodePrivate;

#define GXML_TYPE_NAMESPACE_ATTR (gxml_namespace_attr_get_type ())
#define GXML_NAMESPACE_ATTR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttr))
#define GXML_NAMESPACE_ATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttrClass))
#define GXML_IS_NAMESPACE_ATTR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE_ATTR))
#define GXML_IS_NAMESPACE_ATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMESPACE_ATTR))
#define GXML_NAMESPACE_ATTR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttrClass))

typedef struct _GXmlNamespaceAttr GXmlNamespaceAttr;
typedef struct _GXmlNamespaceAttrClass GXmlNamespaceAttrClass;

#define GXML_TYPE_XNODE_LIST (gxml_xnode_list_get_type ())
#define GXML_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeList))
#define GXML_IS_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE_LIST))
#define GXML_XNODE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeListIface))

typedef struct _GXmlxNodeList GXmlxNodeList;
typedef struct _GXmlxNodeListIface GXmlxNodeListIface;

#define GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP (gxml_abstract_named_attr_map_get_type ())
#define GXML_ABSTRACT_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMap))
#define GXML_ABSTRACT_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMapClass))
#define GXML_IS_ABSTRACT_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP))
#define GXML_IS_ABSTRACT_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP))
#define GXML_ABSTRACT_NAMED_ATTR_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMapClass))

typedef struct _GXmlAbstractNamedAttrMap GXmlAbstractNamedAttrMap;
typedef struct _GXmlAbstractNamedAttrMapClass GXmlAbstractNamedAttrMapClass;

#define GXML_TYPE_NAMED_ATTR_MAP (gxml_named_attr_map_get_type ())
#define GXML_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMap))
#define GXML_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMapClass))
#define GXML_IS_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMED_ATTR_MAP))
#define GXML_IS_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMED_ATTR_MAP))
#define GXML_NAMED_ATTR_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMapClass))

typedef struct _GXmlNamedAttrMap GXmlNamedAttrMap;
typedef struct _GXmlNamedAttrMapClass GXmlNamedAttrMapClass;

#define GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST (gxml_abstract_namespace_attr_node_list_get_type ())
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeList))
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeListClass))
#define GXML_IS_ABSTRACT_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST))
#define GXML_IS_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST))
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeListClass))

typedef struct _GXmlAbstractNamespaceAttrNodeList GXmlAbstractNamespaceAttrNodeList;
typedef struct _GXmlAbstractNamespaceAttrNodeListClass GXmlAbstractNamespaceAttrNodeListClass;

#define GXML_TYPE_NAMESPACE_ATTR_NODE_LIST (gxml_namespace_attr_node_list_get_type ())
#define GXML_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeList))
#define GXML_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeListClass))
#define GXML_IS_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST))
#define GXML_IS_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST))
#define GXML_NAMESPACE_ATTR_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeListClass))

typedef struct _GXmlNamespaceAttrNodeList GXmlNamespaceAttrNodeList;
typedef struct _GXmlNamespaceAttrNodeListClass GXmlNamespaceAttrNodeListClass;

#define GXML_TYPE_BACKED_NODE (gxml_backed_node_get_type ())
#define GXML_BACKED_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_BACKED_NODE, GXmlBackedNode))
#define GXML_BACKED_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_BACKED_NODE, GXmlBackedNodeClass))
#define GXML_IS_BACKED_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_BACKED_NODE))
#define GXML_IS_BACKED_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_BACKED_NODE))
#define GXML_BACKED_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_BACKED_NODE, GXmlBackedNodeClass))

typedef struct _GXmlBackedNode GXmlBackedNode;
typedef struct _GXmlBackedNodeClass GXmlBackedNodeClass;
typedef struct _GXmlBackedNodePrivate GXmlBackedNodePrivate;

#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_XELEMENT (gxml_xelement_get_type ())
#define GXML_XELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XELEMENT, GXmlxElement))
#define GXML_XELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XELEMENT, GXmlxElementClass))
#define GXML_IS_XELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XELEMENT))
#define GXML_IS_XELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XELEMENT))
#define GXML_XELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XELEMENT, GXmlxElementClass))

typedef struct _GXmlxElement GXmlxElement;
typedef struct _GXmlxElementClass GXmlxElementClass;
typedef struct _GXmlxElementPrivate GXmlxElementPrivate;

#define GXML_TYPE_LINKED_LIST (gxml_linked_list_get_type ())
#define GXML_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_LINKED_LIST, GXmlLinkedList))
#define GXML_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_LINKED_LIST, GXmlLinkedListClass))
#define GXML_IS_LINKED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_LINKED_LIST))
#define GXML_IS_LINKED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_LINKED_LIST))
#define GXML_LINKED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_LINKED_LIST, GXmlLinkedListClass))

typedef struct _GXmlLinkedList GXmlLinkedList;
typedef struct _GXmlLinkedListClass GXmlLinkedListClass;

#define GXML_TYPE_TAG_NAME_NODE_LIST (gxml_tag_name_node_list_get_type ())
#define GXML_TAG_NAME_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TAG_NAME_NODE_LIST, GXmlTagNameNodeList))
#define GXML_TAG_NAME_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TAG_NAME_NODE_LIST, GXmlTagNameNodeListClass))
#define GXML_IS_TAG_NAME_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TAG_NAME_NODE_LIST))
#define GXML_IS_TAG_NAME_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TAG_NAME_NODE_LIST))
#define GXML_TAG_NAME_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TAG_NAME_NODE_LIST, GXmlTagNameNodeListClass))

typedef struct _GXmlTagNameNodeList GXmlTagNameNodeList;
typedef struct _GXmlTagNameNodeListClass GXmlTagNameNodeListClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#define GXML_TYPE_XDOCUMENT (gxml_xdocument_get_type ())
#define GXML_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocument))
#define GXML_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))
#define GXML_IS_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XDOCUMENT))
#define GXML_IS_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XDOCUMENT))
#define GXML_XDOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))

typedef struct _GXmlxDocument GXmlxDocument;
typedef struct _GXmlxDocumentClass GXmlxDocumentClass;

#define GXML_TYPE_XATTR (gxml_xattr_get_type ())
#define GXML_XATTR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XATTR, GXmlxAttr))
#define GXML_XATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XATTR, GXmlxAttrClass))
#define GXML_IS_XATTR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XATTR))
#define GXML_IS_XATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XATTR))
#define GXML_XATTR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XATTR, GXmlxAttrClass))

typedef struct _GXmlxAttr GXmlxAttr;
typedef struct _GXmlxAttrClass GXmlxAttrClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GXML_TYPE_NAMED_NODE_MAP (gxml_named_node_map_get_type ())
#define GXML_NAMED_NODE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMED_NODE_MAP, GXmlNamedNodeMap))
#define GXML_IS_NAMED_NODE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMED_NODE_MAP))
#define GXML_NAMED_NODE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NAMED_NODE_MAP, GXmlNamedNodeMapIface))

typedef struct _GXmlNamedNodeMap GXmlNamedNodeMap;
typedef struct _GXmlNamedNodeMapIface GXmlNamedNodeMapIface;
typedef struct _GXmlLinkedListPrivate GXmlLinkedListPrivate;
typedef struct _GXmlTagNameNodeListPrivate GXmlTagNameNodeListPrivate;
#define _g_queue_free0(var) ((var == NULL) ? NULL : (var = (g_queue_free (var), NULL)))
typedef struct _GXmlxDocumentPrivate GXmlxDocumentPrivate;

#define GXML_TYPE_CHILD_NODE_LIST (gxml_child_node_list_get_type ())
#define GXML_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeList))
#define GXML_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))
#define GXML_IS_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_IS_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))

typedef struct _GXmlChildNodeList GXmlChildNodeList;
typedef struct _GXmlChildNodeListClass GXmlChildNodeListClass;

#define GXML_TYPE_NODE_CHILD_NODE_LIST (gxml_node_child_node_list_get_type ())
#define GXML_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList))
#define GXML_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))
#define GXML_IS_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_IS_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_NODE_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))

typedef struct _GXmlNodeChildNodeList GXmlNodeChildNodeList;
typedef struct _GXmlNodeChildNodeListClass GXmlNodeChildNodeListClass;

#define GXML_TYPE_XCHARACTER_DATA (gxml_xcharacter_data_get_type ())
#define GXML_XCHARACTER_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XCHARACTER_DATA, GXmlxCharacterData))
#define GXML_XCHARACTER_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XCHARACTER_DATA, GXmlxCharacterDataClass))
#define GXML_IS_XCHARACTER_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XCHARACTER_DATA))
#define GXML_IS_XCHARACTER_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XCHARACTER_DATA))
#define GXML_XCHARACTER_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XCHARACTER_DATA, GXmlxCharacterDataClass))

typedef struct _GXmlxCharacterData GXmlxCharacterData;
typedef struct _GXmlxCharacterDataClass GXmlxCharacterDataClass;

#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 GXML_TYPE_XTEXT (gxml_xtext_get_type ())
#define GXML_XTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XTEXT, GXmlxText))
#define GXML_XTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XTEXT, GXmlxTextClass))
#define GXML_IS_XTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XTEXT))
#define GXML_IS_XTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XTEXT))
#define GXML_XTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XTEXT, GXmlxTextClass))

typedef struct _GXmlxText GXmlxText;
typedef struct _GXmlxTextClass GXmlxTextClass;

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 _GXmlxNodeListIface {
	GTypeInterface parent_iface;
	GXmlxNode* (*item) (GXmlxNodeList* self, gulong idx);
	GXmlxNode* (*insert_before) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* ref_child);
	GXmlxNode* (*replace_child) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* old_child);
	GXmlxNode* (*remove_child) (GXmlxNodeList* self, GXmlxNode* old_child);
	GXmlxNode* (*append_child) (GXmlxNodeList* self, GXmlxNode* new_child);
	gchar* (*to_string) (GXmlxNodeList* self, gboolean in_line);
	GXmlxNode* (*first) (GXmlxNodeList* self);
	GXmlxNode* (*last) (GXmlxNodeList* self);
	GXmlxNode* (*get) (GXmlxNodeList* self, gint n);
	gulong (*get_length) (GXmlxNodeList* self);
	void (*set_length) (GXmlxNodeList* self, gulong value);
};

struct _GXmlxNode {
	GObject parent_instance;
	GXmlxNodePrivate * priv;
	GXmlxNodeList* _child_nodes;
	GXmlNamedAttrMap* _attributes;
	GXmlNamespaceAttrNodeList* _namespace_definitions;
};

struct _GXmlxNodeClass {
	GObjectClass parent_class;
	GXmlNamespaceAttr* (*add_namespace_attr) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix);
	gboolean (*set_namespace) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix);
	GXmlxNode* (*insert_before) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* ref_child);
	GXmlxNode* (*replace_child) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* old_child);
	GXmlxNode* (*remove_child) (GXmlxNode* self, GXmlxNode* old_child);
	GXmlxNode* (*append_child) (GXmlxNode* self, GXmlxNode* new_child);
	gboolean (*has_child_nodes) (GXmlxNode* self);
	GXmlxNode* (*clone_node) (GXmlxNode* self, gboolean deep);
	gchar* (*stringify) (GXmlxNode* self, gboolean format, gint level);
	gchar* (*to_string) (GXmlxNode* self);
	GeeList* (*get_namespace_definitions) (GXmlxNode* self);
	void (*set_namespace_definitions) (GXmlxNode* self, GeeList* value);
	const gchar* (*get_namespace_uri) (GXmlxNode* self);
	void (*set_namespace_uri) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_namespace_prefix) (GXmlxNode* self);
	void (*set_namespace_prefix) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_local_name) (GXmlxNode* self);
	void (*set_local_name) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_node_name) (GXmlxNode* self);
	void (*set_node_name) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_node_value) (GXmlxNode* self);
	void (*set_node_value) (GXmlxNode* self, const gchar* value);
	GXmlNodeType (*get_node_type) (GXmlxNode* self);
	void (*set_node_type) (GXmlxNode* self, GXmlNodeType value);
	GXmlxNode* (*get_parent_node) (GXmlxNode* self);
	void (*set_parent_node) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNodeList* (*get_child_nodes) (GXmlxNode* self);
	void (*set_child_nodes) (GXmlxNode* self, GXmlxNodeList* value);
	GXmlxNode* (*get_first_child) (GXmlxNode* self);
	void (*set_first_child) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_last_child) (GXmlxNode* self);
	void (*set_last_child) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_previous_sibling) (GXmlxNode* self);
	void (*set_previous_sibling) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_next_sibling) (GXmlxNode* self);
	void (*set_next_sibling) (GXmlxNode* self, GXmlxNode* value);
	GXmlNamedAttrMap* (*get_attributes) (GXmlxNode* self);
	void (*set_attributes) (GXmlxNode* self, GXmlNamedAttrMap* value);
	GeeList* (*get_namespaces) (GXmlxNode* self);
	GeeBidirList* (*get_children) (GXmlxNode* self);
	GeeMap* (*get_attrs) (GXmlxNode* self);
	gchar* (*get_name) (GXmlxNode* self);
	gchar* (*get_value) (GXmlxNode* self);
	void (*set_value) (GXmlxNode* self, const gchar* value);
	GXmlNode* (*get_parent) (GXmlxNode* self);
};

struct _GXmlBackedNode {
	GXmlxNode parent_instance;
	GXmlBackedNodePrivate * priv;
	xmlNode* node;
};

struct _GXmlBackedNodeClass {
	GXmlxNodeClass parent_class;
};

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 _GXmlxElement {
	GXmlBackedNode parent_instance;
	GXmlxElementPrivate * priv;
};

struct _GXmlxElementClass {
	GXmlBackedNodeClass parent_class;
};

struct _GXmlxElementPrivate {
	gchar* _content;
	GList* tag_name_lists;
};

struct _GXmlNamedNodeMapIface {
	GTypeInterface parent_iface;
	gpointer (*get_named_item) (GXmlNamedNodeMap* self, const gchar* name);
	gpointer (*set_named_item) (GXmlNamedNodeMap* self, gconstpointer item);
	gpointer (*remove_named_item) (GXmlNamedNodeMap* self, const gchar* name);
	gpointer (*item) (GXmlNamedNodeMap* self, gulong index);
	gulong (*get_length) (GXmlNamedNodeMap* self);
};

struct _GXmlLinkedList {
	GeeLinkedList parent_instance;
	GXmlLinkedListPrivate * priv;
	GXmlxNode* root;
};

struct _GXmlLinkedListClass {
	GeeLinkedListClass parent_class;
};

struct _GXmlTagNameNodeList {
	GXmlLinkedList parent_instance;
	GXmlTagNameNodeListPrivate * priv;
	gchar* tag_name;
};

struct _GXmlTagNameNodeListClass {
	GXmlLinkedListClass parent_class;
};

struct _GXmlxDocument {
	GXmlxNode parent_instance;
	GXmlxDocumentPrivate * priv;
	GHashTable* node_dict;
	GList* dirty_elements;
	xmlDoc* xmldoc;
	GXmlNodeChildNodeList* _node_list;
};

struct _GXmlxDocumentClass {
	GXmlxNodeClass parent_class;
	GXmlNode* (*get_root) (GXmlxDocument* self);
};

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


static gpointer gxml_xelement_parent_class = NULL;
static GXmlElementIface* gxml_xelement_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_xnode_get_type (void) G_GNUC_CONST;
GType gxml_namespace_attr_get_type (void) G_GNUC_CONST;
GType gxml_xnode_list_get_type (void) G_GNUC_CONST;
GType gxml_abstract_named_attr_map_get_type (void) G_GNUC_CONST;
GType gxml_named_attr_map_get_type (void) G_GNUC_CONST;
GType gxml_abstract_namespace_attr_node_list_get_type (void) G_GNUC_CONST;
GType gxml_namespace_attr_node_list_get_type (void) G_GNUC_CONST;
GType gxml_backed_node_get_type (void) G_GNUC_CONST;
GType gxml_element_get_type (void) G_GNUC_CONST;
GType gxml_xelement_get_type (void) G_GNUC_CONST;
GType gxml_linked_list_get_type (void) G_GNUC_CONST;
GType gxml_tag_name_node_list_get_type (void) G_GNUC_CONST;
#define GXML_XELEMENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GXML_TYPE_XELEMENT, GXmlxElementPrivate))
enum  {
	GXML_XELEMENT_DUMMY_PROPERTY,
	GXML_XELEMENT_TAG_NAME,
	GXML_XELEMENT_NODE_VALUE,
	GXML_XELEMENT_ATTRIBUTES,
	GXML_XELEMENT_CONTENT
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
GType gxml_xdocument_get_type (void) G_GNUC_CONST;
GXmlxElement* gxml_xelement_new (xmlNode* node, GXmlxDocument* doc);
GXmlxElement* gxml_xelement_construct (GType object_type, xmlNode* node, GXmlxDocument* doc);
GXmlBackedNode* gxml_backed_node_new (xmlNode* node, GXmlxDocument* owner);
GXmlBackedNode* gxml_backed_node_construct (GType object_type, xmlNode* node, GXmlxDocument* owner);
gchar* gxml_xelement_get_attribute (GXmlxElement* self, const gchar* name);
GType gxml_xattr_get_type (void) G_GNUC_CONST;
GXmlxAttr* gxml_xelement_get_attribute_node (GXmlxElement* self, const gchar* name);
gchar* gxml_xnode_get_value (GXmlxNode* self);
void gxml_xelement_set_attribute (GXmlxElement* self, const gchar* name, const gchar* value);
GXmlxDocument* gxml_xnode_get_owner_document (GXmlxNode* self);
GXmlxAttr* gxml_xdocument_create_attribute (GXmlxDocument* self, const gchar* name);
void gxml_xnode_set_value (GXmlxNode* self, const gchar* value);
GXmlxAttr* gxml_xelement_set_attribute_node (GXmlxElement* self, GXmlxAttr* new_attr);
void gxml_xelement_remove_attribute (GXmlxElement* self, const gchar* name);
gboolean gxml_xnode_check_read_only (GXmlxNode* self);
GXmlNamedAttrMap* gxml_xnode_get_attributes (GXmlxNode* self);
GType gxml_named_node_map_get_type (void) G_GNUC_CONST;
gpointer gxml_named_node_map_remove_named_item (GXmlNamedNodeMap* self, const gchar* name);
gpointer gxml_named_node_map_get_named_item (GXmlNamedNodeMap* self, const gchar* name);
gpointer gxml_named_node_map_set_named_item (GXmlNamedNodeMap* self, gconstpointer item);
GXmlxAttr* gxml_xelement_remove_attribute_node (GXmlxElement* self, GXmlxAttr* old_attr);
gchar* gxml_xnode_get_name (GXmlxNode* self);
static void gxml_xelement_check_add_tag_name (GXmlxElement* self, GXmlxElement* basenode, GXmlxNode* child);
GXmlNodeType gxml_xnode_get_node_type (GXmlxNode* self);
static void gxml_xelement_on_new_descendant_with_tag_name (GXmlxElement* self, GXmlxElement* elem);
GXmlxNodeList* gxml_xnode_get_child_nodes (GXmlxNode* self);
GXmlxNode* gxml_xnode_list_get (GXmlxNodeList* self, gint n);
static void gxml_xelement_check_remove_tag_name (GXmlxElement* self, GXmlxElement* basenode, GXmlxNode* child);
static void gxml_xelement_on_remove_descendant_with_tag_name (GXmlxElement* self, GXmlxElement* elem);
static GXmlxNode* gxml_xelement_real_insert_before (GXmlxNode* base, GXmlxNode* new_child, GXmlxNode* ref_child);
GXmlxNode* gxml_xnode_insert_before (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* ref_child);
static GXmlxNode* gxml_xelement_real_replace_child (GXmlxNode* base, GXmlxNode* new_child, GXmlxNode* old_child);
GXmlxNode* gxml_xnode_replace_child (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* old_child);
static GXmlxNode* gxml_xelement_real_remove_child (GXmlxNode* base, GXmlxNode* old_child);
GXmlxNode* gxml_xnode_remove_child (GXmlxNode* self, GXmlxNode* old_child);
static GXmlxNode* gxml_xelement_real_append_child (GXmlxNode* base, GXmlxNode* new_child);
GXmlxNode* gxml_xnode_append_child (GXmlxNode* self, GXmlxNode* new_child);
gchar* gxml_element_get_tag_name (GXmlElement* self);
GXmlxNode* gxml_xnode_list_append_child (GXmlxNodeList* self, GXmlxNode* new_child);
GXmlxNode* gxml_xnode_get_parent_node (GXmlxNode* self);
GXmlxNode* gxml_xnode_list_remove_child (GXmlxNodeList* self, GXmlxNode* old_child);
GXmlxNodeList* gxml_xelement_get_elements_by_tag_name (GXmlxElement* self, const gchar* tag_name);
GXmlTagNameNodeList* gxml_tag_name_node_list_new (const gchar* tag_name, GXmlxNode* root, GXmlxDocument* owner);
GXmlTagNameNodeList* gxml_tag_name_node_list_construct (GType object_type, const gchar* tag_name, GXmlxNode* root, GXmlxDocument* owner);
GXmlxNode* gxml_xdocument_lookup_node (GXmlxDocument* self, xmlNode* xmlnode);
static void gxml_xelement_real_normalize (GXmlElement* base);
void gxml_element_normalize (GXmlElement* self);
static gchar* gxml_xelement_real_stringify (GXmlxNode* base, gboolean format, gint level);
GType gxml_child_node_list_get_type (void) G_GNUC_CONST;
GType gxml_node_child_node_list_get_type (void) G_GNUC_CONST;
gchar* gxml_xnode_stringify (GXmlxNode* self, gboolean format, gint level);
static void gxml_xelement_real_set_attr (GXmlElement* base, const gchar* name, const gchar* value);
static GXmlNode* gxml_xelement_real_get_attr (GXmlElement* base, const gchar* name);
static GXmlNode* gxml_xelement_real_get_ns_attr (GXmlElement* base, const gchar* name, const gchar* uri);
GXmlxAttr* gxml_xattr_new (xmlAttr* node, GXmlxDocument* doc);
GXmlxAttr* gxml_xattr_construct (GType object_type, xmlAttr* node, GXmlxDocument* doc);
static void gxml_xelement_real_set_ns_attr (GXmlElement* base, GXmlNamespace* ns, const gchar* name, const gchar* uri);
gboolean gxml_xnode_set_namespace (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix);
gchar* gxml_namespace_get_uri (GXmlNamespace* self);
gchar* gxml_namespace_get_prefix (GXmlNamespace* self);
static void gxml_xelement_real_remove_attr (GXmlElement* base, const gchar* name);
const gchar* gxml_xnode_get_node_name (GXmlxNode* self);
GXmlNamedAttrMap* gxml_named_attr_map_new (GXmlxElement* e);
GXmlNamedAttrMap* gxml_named_attr_map_construct (GType object_type, GXmlxElement* e);
GType gxml_xcharacter_data_get_type (void) G_GNUC_CONST;
const gchar* gxml_xcharacter_data_get_data (GXmlxCharacterData* self);
GeeBidirList* gxml_node_get_childs (GXmlNode* self);
GType gxml_text_get_type (void) G_GNUC_CONST;
GType gxml_xtext_get_type (void) G_GNUC_CONST;
GXmlxText* gxml_xdocument_create_text_node (GXmlxDocument* self, const gchar* text_data);
static void gxml_xelement_finalize (GObject* obj);
const gchar* gxml_xnode_get_node_value (GXmlxNode* self);
gchar* gxml_element_get_content (GXmlElement* self);
static void _vala_gxml_xelement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void gxml_xnode_set_node_value (GXmlxNode* self, const gchar* value);
void gxml_xnode_set_attributes (GXmlxNode* self, GXmlNamedAttrMap* value);
void gxml_element_set_content (GXmlElement* self, const gchar* value);
static void _vala_gxml_xelement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


GXmlxElement* gxml_xelement_construct (GType object_type, xmlNode* node, GXmlxDocument* doc) {
	GXmlxElement * self = NULL;
	xmlNode* _tmp0_ = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	g_return_val_if_fail (doc != NULL, NULL);
	_tmp0_ = node;
	_tmp1_ = doc;
	self = (GXmlxElement*) gxml_backed_node_construct (object_type, _tmp0_, _tmp1_);
	return self;
}


GXmlxElement* gxml_xelement_new (xmlNode* node, GXmlxDocument* doc) {
	return gxml_xelement_construct (GXML_TYPE_XELEMENT, node, doc);
}


/**
 * Retrieve the attribute value, as a string, for an
 * attribute associated with this element with the
 * name name.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-666EE0F9]]
 *
 * @param name The name of the attribute whose value to retrieve
 *
 * @return The value of the named attribute, or "" if
 * no such attribute is set.
 */
gchar* gxml_xelement_get_attribute (GXmlxElement* self, const gchar* name) {
	gchar* result = NULL;
	GXmlxAttr* attr = NULL;
	const gchar* _tmp0_ = NULL;
	GXmlxAttr* _tmp1_ = NULL;
	GXmlxAttr* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = gxml_xelement_get_attribute_node (self, _tmp0_);
	attr = _tmp1_;
	_tmp2_ = attr;
	if (_tmp2_ != NULL) {
		GXmlxAttr* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		_tmp3_ = attr;
		_tmp4_ = gxml_xnode_get_value ((GXmlxNode*) _tmp3_);
		_tmp5_ = _tmp4_;
		result = _tmp5_;
		_g_object_unref0 (attr);
		return result;
	} else {
		gchar* _tmp6_ = NULL;
		_tmp6_ = g_strdup ("");
		result = _tmp6_;
		_g_object_unref0 (attr);
		return result;
	}
	_g_object_unref0 (attr);
}


/**
 * Set the value of this element's attribute named
 * name to the string value.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-F68F082]]
 *
 * @param name Name of the attribute whose value to set
 * @param value The value to set
 */
void gxml_xelement_set_attribute (GXmlxElement* self, const gchar* name, const gchar* value) {
	GXmlxAttr* attr = NULL;
	GXmlxDocument* _tmp0_ = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GXmlxAttr* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	GXmlxAttr* _tmp5_ = NULL;
	GXmlxAttr* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = name;
	_tmp3_ = gxml_xdocument_create_attribute (_tmp1_, _tmp2_);
	_g_object_unref0 (attr);
	attr = _tmp3_;
	_tmp4_ = value;
	gxml_xnode_set_value ((GXmlxNode*) attr, _tmp4_);
	_tmp5_ = gxml_xelement_set_attribute_node (self, attr);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (attr);
}


/**
 * Remove the attribute named name from this element.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-6D6AC0F9]]
 *
 * @param name The name of the attribute to unset
 */
void gxml_xelement_remove_attribute (GXmlxElement* self, const gchar* name) {
	GXmlNamedAttrMap* _tmp0_ = NULL;
	GXmlNamedAttrMap* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	GXmlxAttr* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	gxml_xnode_check_read_only ((GXmlxNode*) self);
	_tmp0_ = gxml_xnode_get_attributes ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = name;
	_tmp3_ = gxml_named_node_map_remove_named_item ((GXmlNamedNodeMap*) _tmp1_, _tmp2_);
	_tmp4_ = (GXmlxAttr*) _tmp3_;
	_g_object_unref0 (_tmp4_);
}


/**
 * Get the Attr node representing this element's attribute named name.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-217A91B8]]
 *
 * @param name The name of the Attr node to retrieve
 *
 * @return The Attr node named by name for this element, or %NULL if none is set
 */
GXmlxAttr* gxml_xelement_get_attribute_node (GXmlxElement* self, const gchar* name) {
	GXmlxAttr* result = NULL;
	GXmlNamedAttrMap* _tmp0_ = NULL;
	GXmlNamedAttrMap* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = gxml_xnode_get_attributes ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = name;
	_tmp3_ = gxml_named_node_map_get_named_item ((GXmlNamedNodeMap*) _tmp1_, _tmp2_);
	result = (GXmlxAttr*) _tmp3_;
	return result;
}


/**
 * Set the attribute in Attr for this element.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-887236154]]
 *
 * @param new_attr The attribute to set
 *
 * @return If an Attr with the same name exists, it
 * is replaced and the old Attr is returned.
 * Elsewise, %NULL is returned.
 */
GXmlxAttr* gxml_xelement_set_attribute_node (GXmlxElement* self, GXmlxAttr* new_attr) {
	GXmlxAttr* result = NULL;
	GXmlNamedAttrMap* _tmp0_ = NULL;
	GXmlNamedAttrMap* _tmp1_ = NULL;
	GXmlxAttr* _tmp2_ = NULL;
	gpointer _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (new_attr != NULL, NULL);
	_tmp0_ = gxml_xnode_get_attributes ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = new_attr;
	_tmp3_ = gxml_named_node_map_set_named_item ((GXmlNamedNodeMap*) _tmp1_, _tmp2_);
	result = (GXmlxAttr*) _tmp3_;
	return result;
}


/**
 * Remove Attr old_attr from this element, if it was
 * set.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-D589198]]
 *
 * @param old_attr The Attr we are removing
 *
 * @return The old_attr we wanted to remove, even if
 * it wasn't found.
 */
GXmlxAttr* gxml_xelement_remove_attribute_node (GXmlxElement* self, GXmlxAttr* old_attr) {
	GXmlxAttr* result = NULL;
	GXmlNamedAttrMap* _tmp0_ = NULL;
	GXmlNamedAttrMap* _tmp1_ = NULL;
	GXmlxAttr* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gpointer _tmp6_ = NULL;
	GXmlxAttr* _tmp7_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old_attr != NULL, NULL);
	gxml_xnode_check_read_only ((GXmlxNode*) self);
	_tmp0_ = gxml_xnode_get_attributes ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = old_attr;
	_tmp3_ = gxml_xnode_get_name ((GXmlxNode*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = gxml_named_node_map_remove_named_item ((GXmlNamedNodeMap*) _tmp1_, _tmp5_);
	_tmp7_ = (GXmlxAttr*) _tmp6_;
	_g_free0 (_tmp5_);
	result = _tmp7_;
	return result;
}


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


static void gxml_xelement_check_add_tag_name (GXmlxElement* self, GXmlxElement* basenode, GXmlxNode* child) {
	gboolean _tmp0_ = FALSE;
	GXmlxNode* _tmp1_ = NULL;
	GXmlNodeType _tmp2_ = 0;
	GXmlNodeType _tmp3_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (basenode != NULL);
	g_return_if_fail (child != NULL);
	_tmp1_ = child;
	_tmp2_ = gxml_xnode_get_node_type (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == GXML_NODE_TYPE_ELEMENT) {
		_tmp0_ = TRUE;
	} else {
		GXmlxNode* _tmp4_ = NULL;
		GXmlNodeType _tmp5_ = 0;
		GXmlNodeType _tmp6_ = 0;
		_tmp4_ = child;
		_tmp5_ = gxml_xnode_get_node_type (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == GXML_NODE_TYPE_DOCUMENT_FRAGMENT;
	}
	if (_tmp0_) {
		GXmlxNode* _tmp7_ = NULL;
		GXmlNodeType _tmp8_ = 0;
		GXmlNodeType _tmp9_ = 0;
		_tmp7_ = child;
		_tmp8_ = gxml_xnode_get_node_type (_tmp7_);
		_tmp9_ = _tmp8_;
		if (_tmp9_ == GXML_NODE_TYPE_ELEMENT) {
			GXmlxElement* _tmp10_ = NULL;
			GXmlxNode* _tmp11_ = NULL;
			_tmp10_ = basenode;
			_tmp11_ = child;
			gxml_xelement_on_new_descendant_with_tag_name (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GXML_TYPE_XELEMENT, GXmlxElement));
		}
		{
			GXmlxNodeList* _grand_child_list = NULL;
			GXmlxNode* _tmp12_ = NULL;
			GXmlxNodeList* _tmp13_ = NULL;
			GXmlxNodeList* _tmp14_ = NULL;
			GXmlxNodeList* _tmp15_ = NULL;
			gint _grand_child_size = 0;
			GXmlxNodeList* _tmp16_ = NULL;
			gint _tmp17_ = 0;
			gint _tmp18_ = 0;
			gint _grand_child_index = 0;
			_tmp12_ = child;
			_tmp13_ = gxml_xnode_get_child_nodes (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = _g_object_ref0 (_tmp14_);
			_grand_child_list = _tmp15_;
			_tmp16_ = _grand_child_list;
			_tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
			_tmp18_ = _tmp17_;
			_grand_child_size = _tmp18_;
			_grand_child_index = -1;
			while (TRUE) {
				gint _tmp19_ = 0;
				gint _tmp20_ = 0;
				gint _tmp21_ = 0;
				GXmlxNode* grand_child = NULL;
				GXmlxNodeList* _tmp22_ = NULL;
				gint _tmp23_ = 0;
				GXmlxNode* _tmp24_ = NULL;
				GXmlxElement* _tmp25_ = NULL;
				GXmlxNode* _tmp26_ = NULL;
				_tmp19_ = _grand_child_index;
				_grand_child_index = _tmp19_ + 1;
				_tmp20_ = _grand_child_index;
				_tmp21_ = _grand_child_size;
				if (!(_tmp20_ < _tmp21_)) {
					break;
				}
				_tmp22_ = _grand_child_list;
				_tmp23_ = _grand_child_index;
				_tmp24_ = gxml_xnode_list_get (_tmp22_, _tmp23_);
				grand_child = _tmp24_;
				_tmp25_ = basenode;
				_tmp26_ = grand_child;
				gxml_xelement_check_add_tag_name (self, _tmp25_, _tmp26_);
				_g_object_unref0 (grand_child);
			}
			_g_object_unref0 (_grand_child_list);
		}
	}
}


/**
 * Checks whether a descendant of a node is an xElement, or whether its descendants
 * are elements.  If they are, we check the basenode and its ancestors to see
 * whether they're keeping that node in a TagNameNodeList, so we can remove it.
 */
static void gxml_xelement_check_remove_tag_name (GXmlxElement* self, GXmlxElement* basenode, GXmlxNode* child) {
	GXmlxNode* _tmp0_ = NULL;
	GXmlNodeType _tmp1_ = 0;
	GXmlNodeType _tmp2_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (basenode != NULL);
	g_return_if_fail (child != NULL);
	_tmp0_ = child;
	_tmp1_ = gxml_xnode_get_node_type (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == GXML_NODE_TYPE_ELEMENT) {
		GXmlxElement* _tmp3_ = NULL;
		GXmlxNode* _tmp4_ = NULL;
		_tmp3_ = basenode;
		_tmp4_ = child;
		gxml_xelement_on_remove_descendant_with_tag_name (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GXML_TYPE_XELEMENT, GXmlxElement));
		{
			GXmlxNodeList* _grand_child_list = NULL;
			GXmlxNode* _tmp5_ = NULL;
			GXmlxNodeList* _tmp6_ = NULL;
			GXmlxNodeList* _tmp7_ = NULL;
			GXmlxNodeList* _tmp8_ = NULL;
			gint _grand_child_size = 0;
			GXmlxNodeList* _tmp9_ = NULL;
			gint _tmp10_ = 0;
			gint _tmp11_ = 0;
			gint _grand_child_index = 0;
			_tmp5_ = child;
			_tmp6_ = gxml_xnode_get_child_nodes (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = _g_object_ref0 (_tmp7_);
			_grand_child_list = _tmp8_;
			_tmp9_ = _grand_child_list;
			_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
			_tmp11_ = _tmp10_;
			_grand_child_size = _tmp11_;
			_grand_child_index = -1;
			while (TRUE) {
				gint _tmp12_ = 0;
				gint _tmp13_ = 0;
				gint _tmp14_ = 0;
				GXmlxNode* grand_child = NULL;
				GXmlxNodeList* _tmp15_ = NULL;
				gint _tmp16_ = 0;
				GXmlxNode* _tmp17_ = NULL;
				GXmlxElement* _tmp18_ = NULL;
				GXmlxNode* _tmp19_ = NULL;
				_tmp12_ = _grand_child_index;
				_grand_child_index = _tmp12_ + 1;
				_tmp13_ = _grand_child_index;
				_tmp14_ = _grand_child_size;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = _grand_child_list;
				_tmp16_ = _grand_child_index;
				_tmp17_ = gxml_xnode_list_get (_tmp15_, _tmp16_);
				grand_child = _tmp17_;
				_tmp18_ = basenode;
				_tmp19_ = grand_child;
				gxml_xelement_check_remove_tag_name (self, _tmp18_, _tmp19_);
				_g_object_unref0 (grand_child);
			}
			_g_object_unref0 (_grand_child_list);
		}
	}
}


/**
 * {@inheritDoc}
 */
static GXmlxNode* gxml_xelement_real_insert_before (GXmlxNode* base, GXmlxNode* new_child, GXmlxNode* ref_child) {
	GXmlxElement * self;
	GXmlxNode* result = NULL;
	GXmlxNode* ret = NULL;
	GXmlxNode* _tmp0_ = NULL;
	GXmlxNode* _tmp1_ = NULL;
	GXmlxNode* _tmp2_ = NULL;
	GXmlxNode* _tmp3_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (new_child != NULL, NULL);
	_tmp0_ = new_child;
	_tmp1_ = ref_child;
	_tmp2_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->insert_before ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode), _tmp0_, _tmp1_);
	ret = _tmp2_;
	_tmp3_ = new_child;
	gxml_xelement_check_add_tag_name (self, self, _tmp3_);
	result = ret;
	return result;
}


/**
 * {@inheritDoc}
 */
static GXmlxNode* gxml_xelement_real_replace_child (GXmlxNode* base, GXmlxNode* new_child, GXmlxNode* old_child) {
	GXmlxElement * self;
	GXmlxNode* result = NULL;
	GXmlxNode* _tmp0_ = NULL;
	GXmlxNode* ret = NULL;
	GXmlxNode* _tmp1_ = NULL;
	GXmlxNode* _tmp2_ = NULL;
	GXmlxNode* _tmp3_ = NULL;
	GXmlxNode* _tmp4_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (new_child != NULL, NULL);
	g_return_val_if_fail (old_child != NULL, NULL);
	_tmp0_ = old_child;
	gxml_xelement_check_remove_tag_name (self, self, _tmp0_);
	_tmp1_ = new_child;
	_tmp2_ = old_child;
	_tmp3_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->replace_child ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode), _tmp1_, _tmp2_);
	ret = _tmp3_;
	_tmp4_ = new_child;
	gxml_xelement_check_add_tag_name (self, self, _tmp4_);
	result = ret;
	return result;
}


/**
 * {@inheritDoc}
 */
static GXmlxNode* gxml_xelement_real_remove_child (GXmlxNode* base, GXmlxNode* old_child) {
	GXmlxElement * self;
	GXmlxNode* result = NULL;
	GXmlxNode* _tmp0_ = NULL;
	GXmlxNode* ret = NULL;
	GXmlxNode* _tmp1_ = NULL;
	GXmlxNode* _tmp2_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (old_child != NULL, NULL);
	_tmp0_ = old_child;
	gxml_xelement_check_remove_tag_name (self, self, _tmp0_);
	_tmp1_ = old_child;
	_tmp2_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->remove_child ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode), _tmp1_);
	ret = _tmp2_;
	result = ret;
	return result;
}


/**
 * {@inheritDoc}
 */
static GXmlxNode* gxml_xelement_real_append_child (GXmlxNode* base, GXmlxNode* new_child) {
	GXmlxElement * self;
	GXmlxNode* result = NULL;
	GXmlxNode* ret = NULL;
	GXmlxNode* _tmp0_ = NULL;
	GXmlxNode* _tmp1_ = NULL;
	GXmlxNode* _tmp2_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (new_child != NULL, NULL);
	_tmp0_ = new_child;
	_tmp1_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->append_child ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode), _tmp0_);
	ret = _tmp1_;
	_tmp2_ = new_child;
	gxml_xelement_check_add_tag_name (self, self, _tmp2_);
	result = ret;
	return result;
}


static void gxml_xelement_on_new_descendant_with_tag_name (GXmlxElement* self, GXmlxElement* elem) {
	GList* _tmp0_ = NULL;
	gboolean _tmp11_ = FALSE;
	GXmlxNode* _tmp12_ = NULL;
	GXmlxNode* _tmp13_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (elem != NULL);
	_tmp0_ = self->priv->tag_name_lists;
	{
		GList* list_collection = NULL;
		GList* list_it = NULL;
		list_collection = _tmp0_;
		for (list_it = list_collection; list_it != NULL; list_it = list_it->next) {
			GXmlTagNameNodeList* _tmp1_ = NULL;
			GXmlTagNameNodeList* list = NULL;
			_tmp1_ = _g_object_ref0 ((GXmlTagNameNodeList*) list_it->data);
			list = _tmp1_;
			{
				GXmlxElement* _tmp2_ = NULL;
				gchar* _tmp3_ = NULL;
				gchar* _tmp4_ = NULL;
				gchar* _tmp5_ = NULL;
				GXmlTagNameNodeList* _tmp6_ = NULL;
				const gchar* _tmp7_ = NULL;
				gboolean _tmp8_ = FALSE;
				_tmp2_ = elem;
				_tmp3_ = gxml_element_get_tag_name ((GXmlElement*) _tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = _tmp4_;
				_tmp6_ = list;
				_tmp7_ = _tmp6_->tag_name;
				_tmp8_ = g_strcmp0 (_tmp5_, _tmp7_) == 0;
				_g_free0 (_tmp5_);
				if (_tmp8_) {
					GXmlTagNameNodeList* _tmp9_ = NULL;
					GXmlxElement* _tmp10_ = NULL;
					_tmp9_ = list;
					_tmp10_ = elem;
					gxml_xnode_list_append_child ((GXmlxNodeList*) _tmp9_, (GXmlxNode*) _tmp10_);
					_g_object_unref0 (list);
					break;
				}
				_g_object_unref0 (list);
			}
		}
	}
	_tmp12_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
	_tmp13_ = _tmp12_;
	if (_tmp13_ != NULL) {
		GXmlxNode* _tmp14_ = NULL;
		GXmlxNode* _tmp15_ = NULL;
		GXmlNodeType _tmp16_ = 0;
		GXmlNodeType _tmp17_ = 0;
		_tmp14_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
		_tmp15_ = _tmp14_;
		_tmp16_ = gxml_xnode_get_node_type (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp11_ = _tmp17_ == GXML_NODE_TYPE_ELEMENT;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		GXmlxNode* _tmp18_ = NULL;
		GXmlxNode* _tmp19_ = NULL;
		GXmlxElement* _tmp20_ = NULL;
		_tmp18_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
		_tmp19_ = _tmp18_;
		_tmp20_ = elem;
		gxml_xelement_on_new_descendant_with_tag_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GXML_TYPE_XELEMENT, GXmlxElement), _tmp20_);
	}
}


/**
 * Checks whether this element has a TagNameNodeList containing this element,
 * and if so, removes it.  It also asks the parents above if they have such
 * a list.
 */
static void gxml_xelement_on_remove_descendant_with_tag_name (GXmlxElement* self, GXmlxElement* elem) {
	GList* _tmp0_ = NULL;
	gboolean _tmp24_ = FALSE;
	GXmlxNode* _tmp25_ = NULL;
	GXmlxNode* _tmp26_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (elem != NULL);
	_tmp0_ = self->priv->tag_name_lists;
	{
		GList* list_collection = NULL;
		GList* list_it = NULL;
		list_collection = _tmp0_;
		for (list_it = list_collection; list_it != NULL; list_it = list_it->next) {
			GXmlTagNameNodeList* _tmp1_ = NULL;
			GXmlTagNameNodeList* list = NULL;
			_tmp1_ = _g_object_ref0 ((GXmlTagNameNodeList*) list_it->data);
			list = _tmp1_;
			{
				GXmlxElement* _tmp2_ = NULL;
				gchar* _tmp3_ = NULL;
				gchar* _tmp4_ = NULL;
				gchar* _tmp5_ = NULL;
				GXmlTagNameNodeList* _tmp6_ = NULL;
				const gchar* _tmp7_ = NULL;
				gboolean _tmp8_ = FALSE;
				_tmp2_ = elem;
				_tmp3_ = gxml_element_get_tag_name ((GXmlElement*) _tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = _tmp4_;
				_tmp6_ = list;
				_tmp7_ = _tmp6_->tag_name;
				_tmp8_ = g_strcmp0 (_tmp5_, _tmp7_) == 0;
				_g_free0 (_tmp5_);
				if (_tmp8_) {
					{
						GXmlTagNameNodeList* _tag_elem_list = NULL;
						GXmlTagNameNodeList* _tmp9_ = NULL;
						GXmlTagNameNodeList* _tmp10_ = NULL;
						gint _tag_elem_size = 0;
						GXmlTagNameNodeList* _tmp11_ = NULL;
						gint _tmp12_ = 0;
						gint _tmp13_ = 0;
						gint _tag_elem_index = 0;
						_tmp9_ = list;
						_tmp10_ = _g_object_ref0 (_tmp9_);
						_tag_elem_list = _tmp10_;
						_tmp11_ = _tag_elem_list;
						_tmp12_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp11_);
						_tmp13_ = _tmp12_;
						_tag_elem_size = _tmp13_;
						_tag_elem_index = -1;
						while (TRUE) {
							gint _tmp14_ = 0;
							gint _tmp15_ = 0;
							gint _tmp16_ = 0;
							GXmlxNode* tag_elem = NULL;
							GXmlTagNameNodeList* _tmp17_ = NULL;
							gint _tmp18_ = 0;
							GXmlxNode* _tmp19_ = NULL;
							GXmlxNode* _tmp20_ = NULL;
							GXmlxElement* _tmp21_ = NULL;
							_tmp14_ = _tag_elem_index;
							_tag_elem_index = _tmp14_ + 1;
							_tmp15_ = _tag_elem_index;
							_tmp16_ = _tag_elem_size;
							if (!(_tmp15_ < _tmp16_)) {
								break;
							}
							_tmp17_ = _tag_elem_list;
							_tmp18_ = _tag_elem_index;
							_tmp19_ = gxml_xnode_list_get ((GXmlxNodeList*) _tmp17_, _tmp18_);
							tag_elem = _tmp19_;
							_tmp20_ = tag_elem;
							_tmp21_ = elem;
							if (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GXML_TYPE_XELEMENT, GXmlxElement) == _tmp21_) {
								GXmlTagNameNodeList* _tmp22_ = NULL;
								GXmlxNode* _tmp23_ = NULL;
								_tmp22_ = list;
								_tmp23_ = tag_elem;
								gxml_xnode_list_remove_child ((GXmlxNodeList*) _tmp22_, _tmp23_);
								_g_object_unref0 (tag_elem);
								break;
							}
							_g_object_unref0 (tag_elem);
						}
						_g_object_unref0 (_tag_elem_list);
					}
					_g_object_unref0 (list);
					break;
				}
				_g_object_unref0 (list);
			}
		}
	}
	_tmp25_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
	_tmp26_ = _tmp25_;
	if (_tmp26_ != NULL) {
		GXmlxNode* _tmp27_ = NULL;
		GXmlxNode* _tmp28_ = NULL;
		GXmlNodeType _tmp29_ = 0;
		GXmlNodeType _tmp30_ = 0;
		_tmp27_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
		_tmp28_ = _tmp27_;
		_tmp29_ = gxml_xnode_get_node_type (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp24_ = _tmp30_ == GXML_NODE_TYPE_ELEMENT;
	} else {
		_tmp24_ = FALSE;
	}
	if (_tmp24_) {
		GXmlxNode* _tmp31_ = NULL;
		GXmlxNode* _tmp32_ = NULL;
		GXmlxElement* _tmp33_ = NULL;
		_tmp31_ = gxml_xnode_get_parent_node ((GXmlxNode*) self);
		_tmp32_ = _tmp31_;
		_tmp33_ = elem;
		gxml_xelement_on_remove_descendant_with_tag_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GXML_TYPE_XELEMENT, GXmlxElement), _tmp33_);
	}
}


/**
 * Obtains a NodeList of Elements with the given
 * tag_name that are descendants of this xElement.
 * This will include the current element if it
 * matches. The returned list is updated as necessary
 * as the tree changes.
 * 
 * Visual explanation of get_elements_by_tag_name tree traversal.
 * {{{
 * a
 *  b    c
 * d e  f g
 *
 * we want: a b d e c f g
 *
 * start:
 * add a
 *
 * pop top of stack (a)
 * a: check for match: yes? add to return list
 * a: add children from last to first (c,b) to top of stack (so head=b, then c)
 *
 * a
 * a< [bc]
 * b< [de]c
 * d< ec
 * e< c
 * c< [fg]
 * f< g
 * g<
 *
 * see a, add a, visit a
 * }}}
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1938918D]]
 *
 * @param tag_name The tag name to match for
 *
 * @return A NodeList containing the matching descendants
 * 
 */
GXmlxNodeList* gxml_xelement_get_elements_by_tag_name (GXmlxElement* self, const gchar* tag_name) {
	GXmlxNodeList* result = NULL;
	GXmlTagNameNodeList* tagged = NULL;
	const gchar* _tmp0_ = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	GXmlxDocument* _tmp2_ = NULL;
	GXmlTagNameNodeList* _tmp3_ = NULL;
	GQueue* tocheck = NULL;
	GQueue* _tmp4_ = NULL;
	GQueue* _tmp5_ = NULL;
	xmlNode* _tmp6_ = NULL;
	GXmlTagNameNodeList* _tmp27_ = NULL;
	GXmlTagNameNodeList* _tmp28_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tag_name != NULL, NULL);
	_tmp0_ = tag_name;
	_tmp1_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = gxml_tag_name_node_list_new (_tmp0_, (GXmlxNode*) self, _tmp2_);
	tagged = _tmp3_;
	_tmp4_ = g_queue_new ();
	tocheck = _tmp4_;
	_tmp5_ = tocheck;
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode)->node;
	g_queue_push_head (_tmp5_, _tmp6_);
	while (TRUE) {
		GQueue* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		xmlNode* cur = NULL;
		GQueue* _tmp9_ = NULL;
		gpointer _tmp10_ = NULL;
		xmlNode* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		_tmp7_ = tocheck;
		_tmp8_ = g_queue_is_empty (_tmp7_);
		if (!(_tmp8_ == FALSE)) {
			break;
		}
		_tmp9_ = tocheck;
		_tmp10_ = g_queue_pop_head (_tmp9_);
		cur = _tmp10_;
		_tmp11_ = cur;
		_tmp12_ = _tmp11_->name;
		_tmp13_ = tag_name;
		if (g_strcmp0 (_tmp12_, _tmp13_) == 0) {
			GXmlTagNameNodeList* _tmp14_ = NULL;
			GXmlxDocument* _tmp15_ = NULL;
			GXmlxDocument* _tmp16_ = NULL;
			xmlNode* _tmp17_ = NULL;
			GXmlxNode* _tmp18_ = NULL;
			_tmp14_ = tagged;
			_tmp15_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
			_tmp16_ = _tmp15_;
			_tmp17_ = cur;
			_tmp18_ = gxml_xdocument_lookup_node (_tmp16_, _tmp17_);
			gxml_xnode_list_append_child ((GXmlxNodeList*) _tmp14_, _tmp18_);
		}
		{
			xmlNode* child = NULL;
			xmlNode* _tmp19_ = NULL;
			xmlNode* _tmp20_ = NULL;
			_tmp19_ = cur;
			_tmp20_ = _tmp19_->last;
			child = _tmp20_;
			{
				gboolean _tmp21_ = FALSE;
				_tmp21_ = TRUE;
				while (TRUE) {
					xmlNode* _tmp24_ = NULL;
					GQueue* _tmp25_ = NULL;
					xmlNode* _tmp26_ = NULL;
					if (!_tmp21_) {
						xmlNode* _tmp22_ = NULL;
						xmlNode* _tmp23_ = NULL;
						_tmp22_ = child;
						_tmp23_ = _tmp22_->prev;
						child = _tmp23_;
					}
					_tmp21_ = FALSE;
					_tmp24_ = child;
					if (!(_tmp24_ != NULL)) {
						break;
					}
					_tmp25_ = tocheck;
					_tmp26_ = child;
					g_queue_push_head (_tmp25_, _tmp26_);
				}
			}
		}
	}
	_tmp27_ = tagged;
	_tmp28_ = _g_object_ref0 (_tmp27_);
	self->priv->tag_name_lists = g_list_append (self->priv->tag_name_lists, _tmp28_);
	result = (GXmlxNodeList*) tagged;
	_g_queue_free0 (tocheck);
	return result;
}


/**
 * This merges all adjacent Text nodes that are
 * descendants of this element. Sibling Text nodes
 * are not distinguishable in XML when stored outside
 * of the DOM.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-162CF083]]
 */
static void gxml_xelement_real_normalize (GXmlElement* base) {
	GXmlxElement * self;
	self = (GXmlxElement*) base;
	{
		GXmlxNodeList* _child_list = NULL;
		GXmlxNodeList* _tmp0_ = NULL;
		GXmlxNodeList* _tmp1_ = NULL;
		GXmlxNodeList* _tmp2_ = NULL;
		gint _child_size = 0;
		GXmlxNodeList* _tmp3_ = NULL;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		gint _child_index = 0;
		_tmp0_ = gxml_xnode_get_child_nodes ((GXmlxNode*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_child_list = _tmp2_;
		_tmp3_ = _child_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_child_size = _tmp5_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			gint _tmp8_ = 0;
			GXmlxNode* child = NULL;
			GXmlxNodeList* _tmp9_ = NULL;
			gint _tmp10_ = 0;
			GXmlxNode* _tmp11_ = NULL;
			GXmlxNode* _tmp12_ = NULL;
			GXmlNodeType _tmp13_ = 0;
			GXmlNodeType _tmp14_ = 0;
			_tmp6_ = _child_index;
			_child_index = _tmp6_ + 1;
			_tmp7_ = _child_index;
			_tmp8_ = _child_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _child_list;
			_tmp10_ = _child_index;
			_tmp11_ = gxml_xnode_list_get (_tmp9_, _tmp10_);
			child = _tmp11_;
			_tmp12_ = child;
			_tmp13_ = gxml_xnode_get_node_type (_tmp12_);
			_tmp14_ = _tmp13_;
			switch (_tmp14_) {
				case GXML_NODE_TYPE_ELEMENT:
				{
					GXmlxNode* _tmp15_ = NULL;
					_tmp15_ = child;
					gxml_element_normalize ((GXmlElement*) G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GXML_TYPE_XELEMENT, GXmlxElement));
					break;
				}
				case GXML_NODE_TYPE_TEXT:
				{
					break;
				}
				default:
				break;
			}
			_g_object_unref0 (child);
		}
		_g_object_unref0 (_child_list);
	}
}


/**
 * {@inheritDoc}
 */
static gchar* gxml_xelement_real_stringify (GXmlxNode* base, gboolean format, gint level) {
	GXmlxElement * self;
	gchar* result = NULL;
	GXmlxDocument* _tmp0_ = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	GXmlxElement* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gint _tmp4_ = 0;
	gchar* _tmp5_ = NULL;
	self = (GXmlxElement*) base;
	_tmp0_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (self);
	_tmp1_->dirty_elements = g_list_append (_tmp1_->dirty_elements, _tmp2_);
	_tmp3_ = format;
	_tmp4_ = level;
	_tmp5_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->stringify ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode), _tmp3_, _tmp4_);
	result = _tmp5_;
	return result;
}


static void gxml_xelement_real_set_attr (GXmlElement* base, const gchar* name, const gchar* value) {
	GXmlxElement * self;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = (GXmlxElement*) base;
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = name;
	_tmp1_ = value;
	gxml_xelement_set_attribute (self, _tmp0_, _tmp1_);
}


static GXmlNode* gxml_xelement_real_get_attr (GXmlElement* base, const gchar* name) {
	GXmlxElement * self;
	GXmlNode* result = NULL;
	const gchar* _tmp0_ = NULL;
	GXmlxAttr* _tmp1_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = gxml_xelement_get_attribute_node (self, _tmp0_);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GXML_TYPE_NODE, GXmlNode);
	return result;
}


static GXmlNode* gxml_xelement_real_get_ns_attr (GXmlElement* base, const gchar* name, const gchar* uri) {
	GXmlxElement * self;
	GXmlNode* result = NULL;
	xmlNode* _tmp0_ = NULL;
	xmlAttr* a = NULL;
	xmlNode* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	xmlAttr* _tmp4_ = NULL;
	xmlAttr* _tmp5_ = NULL;
	xmlAttr* _tmp6_ = NULL;
	GXmlxDocument* _tmp7_ = NULL;
	GXmlxDocument* _tmp8_ = NULL;
	GXmlxAttr* _tmp9_ = NULL;
	self = (GXmlxElement*) base;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (uri != NULL, NULL);
	_tmp0_ = ((GXmlBackedNode*) self)->node;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = ((GXmlBackedNode*) self)->node;
	_tmp2_ = name;
	_tmp3_ = uri;
	_tmp4_ = xmlHasNsProp (_tmp1_, (xmlChar*) _tmp2_, (xmlChar*) _tmp3_);
	a = _tmp4_;
	_tmp5_ = a;
	if (_tmp5_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp6_ = a;
	_tmp7_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = gxml_xattr_new (_tmp6_, _tmp8_);
	result = (GXmlNode*) _tmp9_;
	return result;
}


static void gxml_xelement_real_set_ns_attr (GXmlElement* base, GXmlNamespace* ns, const gchar* name, const gchar* uri) {
	GXmlxElement * self;
	xmlNode* _tmp0_ = NULL;
	GXmlxAttr* attr = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	GXmlxDocument* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GXmlxAttr* _tmp4_ = NULL;
	GXmlxAttr* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	GXmlxAttr* _tmp9_ = NULL;
	GXmlxAttr* _tmp10_ = NULL;
	GXmlxAttr* _tmp11_ = NULL;
	GXmlxAttr* _tmp12_ = NULL;
	GXmlNamespace* _tmp13_ = NULL;
	gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	GXmlNamespace* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	self = (GXmlxElement*) base;
	g_return_if_fail (ns != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (uri != NULL);
	_tmp0_ = ((GXmlBackedNode*) self)->node;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = name;
	_tmp4_ = gxml_xdocument_create_attribute (_tmp2_, _tmp3_);
	attr = _tmp4_;
	_tmp5_ = attr;
	_tmp6_ = gxml_xnode_get_value ((GXmlxNode*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	gxml_xnode_set_value ((GXmlxNode*) _tmp5_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = attr;
	_tmp10_ = gxml_xelement_set_attribute_node (self, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp11_);
	_tmp12_ = attr;
	_tmp13_ = ns;
	_tmp14_ = gxml_namespace_get_uri (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_;
	_tmp17_ = ns;
	_tmp18_ = gxml_namespace_get_prefix (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_;
	gxml_xnode_set_namespace ((GXmlxNode*) _tmp12_, _tmp16_, _tmp20_);
	_g_free0 (_tmp20_);
	_g_free0 (_tmp16_);
	_g_object_unref0 (attr);
}


static void gxml_xelement_real_remove_attr (GXmlElement* base, const gchar* name) {
	GXmlxElement * self;
	const gchar* _tmp0_ = NULL;
	self = (GXmlxElement*) base;
	g_return_if_fail (name != NULL);
	_tmp0_ = name;
	gxml_xelement_remove_attribute (self, _tmp0_);
}


static gchar* gxml_xelement_real_get_tag_name (GXmlElement* base) {
	gchar* result;
	GXmlxElement* self;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	self = (GXmlxElement*) base;
	_tmp0_ = GXML_XNODE_CLASS (gxml_xelement_parent_class)->get_node_name ((GXmlxNode*) G_TYPE_CHECK_INSTANCE_CAST (self, GXML_TYPE_BACKED_NODE, GXmlBackedNode));
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


static const gchar* gxml_xelement_real_get_node_value (GXmlxNode* base) {
	const gchar* result;
	GXmlxElement* self;
	self = (GXmlxElement*) base;
	result = NULL;
	return result;
}


static void gxml_xelement_real_set_node_value (GXmlxNode* base, const gchar* value) {
	GXmlxElement* self;
	self = (GXmlxElement*) base;
	g_object_notify ((GObject *) self, "node-value");
}


static GXmlNamedAttrMap* gxml_xelement_real_get_attributes (GXmlxNode* base) {
	GXmlNamedAttrMap* result;
	GXmlxElement* self;
	GXmlNamedAttrMap* _tmp0_ = NULL;
	GXmlNamedAttrMap* _tmp2_ = NULL;
	self = (GXmlxElement*) base;
	_tmp0_ = ((GXmlxNode*) self)->_attributes;
	if (_tmp0_ == NULL) {
		GXmlNamedAttrMap* _tmp1_ = NULL;
		_tmp1_ = gxml_named_attr_map_new (self);
		_g_object_unref0 (((GXmlxNode*) self)->_attributes);
		((GXmlxNode*) self)->_attributes = _tmp1_;
	}
	_tmp2_ = ((GXmlxNode*) self)->_attributes;
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMap);
	return result;
}


static void gxml_xelement_real_set_attributes (GXmlxNode* base, GXmlNamedAttrMap* value) {
	GXmlxElement* self;
	self = (GXmlxElement*) base;
	g_object_notify ((GObject *) self, "attributes");
}


static gchar* gxml_xelement_real_get_content (GXmlElement* base) {
	gchar* result;
	GXmlxElement* self;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp19_ = NULL;
	gchar* _tmp20_ = NULL;
	self = (GXmlxElement*) base;
	_tmp0_ = g_strdup ("");
	_g_free0 (self->priv->_content);
	self->priv->_content = _tmp0_;
	{
		GXmlxNodeList* _n_list = NULL;
		GXmlxNodeList* _tmp1_ = NULL;
		GXmlxNodeList* _tmp2_ = NULL;
		GXmlxNodeList* _tmp3_ = NULL;
		gint _n_size = 0;
		GXmlxNodeList* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gint _n_index = 0;
		_tmp1_ = gxml_xnode_get_child_nodes ((GXmlxNode*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_n_list = _tmp3_;
		_tmp4_ = _n_list;
		_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_n_size = _tmp6_;
		_n_index = -1;
		while (TRUE) {
			gint _tmp7_ = 0;
			gint _tmp8_ = 0;
			gint _tmp9_ = 0;
			GXmlxNode* n = NULL;
			GXmlxNodeList* _tmp10_ = NULL;
			gint _tmp11_ = 0;
			GXmlxNode* _tmp12_ = NULL;
			GXmlxNode* _tmp13_ = NULL;
			_tmp7_ = _n_index;
			_n_index = _tmp7_ + 1;
			_tmp8_ = _n_index;
			_tmp9_ = _n_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _n_list;
			_tmp11_ = _n_index;
			_tmp12_ = gxml_xnode_list_get (_tmp10_, _tmp11_);
			n = _tmp12_;
			_tmp13_ = n;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, GXML_TYPE_XCHARACTER_DATA)) {
				const gchar* _tmp14_ = NULL;
				GXmlxNode* _tmp15_ = NULL;
				const gchar* _tmp16_ = NULL;
				const gchar* _tmp17_ = NULL;
				gchar* _tmp18_ = NULL;
				_tmp14_ = self->priv->_content;
				_tmp15_ = n;
				_tmp16_ = gxml_xcharacter_data_get_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GXML_TYPE_XCHARACTER_DATA, GXmlxCharacterData));
				_tmp17_ = _tmp16_;
				_tmp18_ = g_strconcat (_tmp14_, _tmp17_, NULL);
				_g_free0 (self->priv->_content);
				self->priv->_content = _tmp18_;
			}
			_g_object_unref0 (n);
		}
		_g_object_unref0 (_n_list);
	}
	_tmp19_ = self->priv->_content;
	_tmp20_ = g_strdup (_tmp19_);
	result = _tmp20_;
	return result;
}


static void gxml_xelement_real_set_content (GXmlElement* base, const gchar* value) {
	GXmlxElement* self;
	const gchar* _tmp0_ = NULL;
	self = (GXmlxElement*) base;
	_tmp0_ = value;
	if (_tmp0_ != NULL) {
		GXmlxText* t = NULL;
		GXmlxDocument* _tmp23_ = NULL;
		GXmlxDocument* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		GXmlxText* _tmp26_ = NULL;
		GXmlxText* _tmp27_ = NULL;
		GXmlxText* _tmp28_ = NULL;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp1_ = FALSE;
				_tmp1_ = TRUE;
				while (TRUE) {
					gint _tmp3_ = 0;
					GeeBidirList* _tmp4_ = NULL;
					GeeBidirList* _tmp5_ = NULL;
					GeeBidirList* _tmp6_ = NULL;
					gint _tmp7_ = 0;
					gint _tmp8_ = 0;
					gboolean _tmp9_ = FALSE;
					GXmlNode* n = NULL;
					GeeBidirList* _tmp10_ = NULL;
					GeeBidirList* _tmp11_ = NULL;
					GeeBidirList* _tmp12_ = NULL;
					gint _tmp13_ = 0;
					gpointer _tmp14_ = NULL;
					GXmlNode* _tmp15_ = NULL;
					GXmlNode* _tmp16_ = NULL;
					if (!_tmp1_) {
						gint _tmp2_ = 0;
						_tmp2_ = i;
						i = _tmp2_ + 1;
					}
					_tmp1_ = FALSE;
					_tmp3_ = i;
					_tmp4_ = gxml_node_get_childs ((GXmlNode*) self);
					_tmp5_ = _tmp4_;
					_tmp6_ = _tmp5_;
					_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
					_tmp8_ = _tmp7_;
					_tmp9_ = !(_tmp3_ < _tmp8_);
					_g_object_unref0 (_tmp6_);
					if (_tmp9_) {
						break;
					}
					_tmp10_ = gxml_node_get_childs ((GXmlNode*) self);
					_tmp11_ = _tmp10_;
					_tmp12_ = _tmp11_;
					_tmp13_ = i;
					_tmp14_ = gee_list_get ((GeeList*) _tmp12_, _tmp13_);
					_tmp15_ = (GXmlNode*) _tmp14_;
					_g_object_unref0 (_tmp12_);
					n = _tmp15_;
					_tmp16_ = n;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, GXML_TYPE_TEXT)) {
						GeeBidirList* _tmp17_ = NULL;
						GeeBidirList* _tmp18_ = NULL;
						GeeBidirList* _tmp19_ = NULL;
						gint _tmp20_ = 0;
						gpointer _tmp21_ = NULL;
						GXmlNode* _tmp22_ = NULL;
						_tmp17_ = gxml_node_get_childs ((GXmlNode*) self);
						_tmp18_ = _tmp17_;
						_tmp19_ = _tmp18_;
						_tmp20_ = i;
						_tmp21_ = gee_list_remove_at ((GeeList*) _tmp19_, _tmp20_);
						_tmp22_ = (GXmlNode*) _tmp21_;
						_g_object_unref0 (_tmp22_);
						_g_object_unref0 (_tmp19_);
					}
					_g_object_unref0 (n);
				}
			}
		}
		_tmp23_ = gxml_xnode_get_owner_document ((GXmlxNode*) self);
		_tmp24_ = _tmp23_;
		_tmp25_ = value;
		_tmp26_ = gxml_xdocument_create_text_node (_tmp24_, _tmp25_);
		_tmp27_ = _g_object_ref0 (_tmp26_);
		t = _tmp27_;
		_tmp28_ = t;
		gxml_xnode_append_child ((GXmlxNode*) self, (GXmlxNode*) _tmp28_);
		_g_object_unref0 (t);
	}
	g_object_notify ((GObject *) self, "content");
}


static void gxml_xelement_class_init (GXmlxElementClass * klass) {
	gxml_xelement_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GXmlxElementPrivate));
	((GXmlxNodeClass *) klass)->insert_before = gxml_xelement_real_insert_before;
	((GXmlxNodeClass *) klass)->replace_child = gxml_xelement_real_replace_child;
	((GXmlxNodeClass *) klass)->remove_child = gxml_xelement_real_remove_child;
	((GXmlxNodeClass *) klass)->append_child = gxml_xelement_real_append_child;
	((GXmlxNodeClass *) klass)->stringify = gxml_xelement_real_stringify;
	GXML_XNODE_CLASS (klass)->get_node_value = gxml_xelement_real_get_node_value;
	GXML_XNODE_CLASS (klass)->set_node_value = gxml_xelement_real_set_node_value;
	GXML_XNODE_CLASS (klass)->get_attributes = gxml_xelement_real_get_attributes;
	GXML_XNODE_CLASS (klass)->set_attributes = gxml_xelement_real_set_attributes;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xelement_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_xelement_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xelement_finalize;
	/**
	 * The element's tag_name. Multiple elements can have
	 * the same tag name in a document.
	 *
	 * Version: DOM Level 1 Core<<BR>>
	 * URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-104682815]]
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XELEMENT_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));
	/**
	 * Elements do not have a node_value. Instead, their
	 * contents are stored in Attr attributes and in
	 * child_nodes.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XELEMENT_NODE_VALUE, g_param_spec_string ("node-value", "node-value", "node-value", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Contains a {@link GXml.NamedAttrMap} of
	 * {@link GXml.Attribute} attributes associated with this
	 * {@link GXml.xElement}.
	 *
	 * Attributes in the NamedNodeMap are updated live, so
	 * changes in the element's attributes through its
	 * other methods are reflected in the attributes
	 *
	 * Do not free this or its contents.  It's memory will
	 * be released when the owning {@link GXml.xDocument}
	 * is freed.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XELEMENT_ATTRIBUTES, g_param_spec_object ("attributes", "attributes", "attributes", GXML_TYPE_NAMED_ATTR_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * This is a convenience property for Elements, useful
	 * when you want to see Text descendents of an
	 * element. With the XML example
	 * {{{<shops>
	 *   <shop id="1">Eeylops Owl Emporium</shop>
	 *   <shop id="2">Obscurus Books</shop>
	 * </shops>}}}
	 * taking the
	 * node for the shop element with id 1 and using this
	 * method, you would get back "Eeylops Owl Emporiums".
	 * If you used it on the shops element, you'd get
	 * {{{Eeylops Owl EmporiumObscurus Books}}} with the
	 * XML tags omitted.
	 *
	 * This property search and contatenade all children {@link GXml.Text}
	 * in the {@link GXml.Node} and returns them, no mutter were they
	 * are in the tree of childs. When setting, this property creates a new
	 * {@link GXml.Text} and add it to this {@link GXml.Element}.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XELEMENT_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));
}


static void gxml_xelement_gxml_element_interface_init (GXmlElementIface * iface) {
	gxml_xelement_gxml_element_parent_iface = g_type_interface_peek_parent (iface);
	iface->normalize = (void (*)(GXmlElement*)) gxml_xelement_real_normalize;
	iface->set_attr = (void (*)(GXmlElement*, const gchar*, const gchar*)) gxml_xelement_real_set_attr;
	iface->get_attr = (GXmlNode* (*)(GXmlElement*, const gchar*)) gxml_xelement_real_get_attr;
	iface->get_ns_attr = (GXmlNode* (*)(GXmlElement*, const gchar*, const gchar*)) gxml_xelement_real_get_ns_attr;
	iface->set_ns_attr = (void (*)(GXmlElement*, GXmlNamespace*, const gchar*, const gchar*)) gxml_xelement_real_set_ns_attr;
	iface->remove_attr = (void (*)(GXmlElement*, const gchar*)) gxml_xelement_real_remove_attr;
	iface->get_tag_name = gxml_xelement_real_get_tag_name;
	iface->get_content = gxml_xelement_real_get_content;
	iface->set_content = gxml_xelement_real_set_content;
}


static void gxml_xelement_instance_init (GXmlxElement * self) {
	self->priv = GXML_XELEMENT_GET_PRIVATE (self);
	self->priv->_content = NULL;
	self->priv->tag_name_lists = NULL;
}


static void gxml_xelement_finalize (GObject* obj) {
	GXmlxElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_XELEMENT, GXmlxElement);
	_g_free0 (self->priv->_content);
	__g_list_free__g_object_unref0_0 (self->priv->tag_name_lists);
	G_OBJECT_CLASS (gxml_xelement_parent_class)->finalize (obj);
}


/**
 * Represent an XML xElement node, which have attributes and children.
 *
 * To create one, use {@link GXml.xDocument.create_element}.
 *
 * These can have child nodes
 * of various types including other Elements. Elements can
 * have Attr attributes associated with them. Elements have
 * tag names. In addition to methods inherited from Node,
 * Elements have additional methods for manipulating
 * attributes, as an alternative to manipulating the
 * attributes HashMap directly.
 *
 * Version: DOM Level 1 Core<<BR>>
 * URL: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-745549614]]
 */
GType gxml_xelement_get_type (void) {
	static volatile gsize gxml_xelement_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_xelement_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlxElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xelement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlxElement), 0, (GInstanceInitFunc) gxml_xelement_instance_init, NULL };
		static const GInterfaceInfo gxml_element_info = { (GInterfaceInitFunc) gxml_xelement_gxml_element_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gxml_xelement_type_id;
		gxml_xelement_type_id = g_type_register_static (GXML_TYPE_BACKED_NODE, "GXmlxElement", &g_define_type_info, 0);
		g_type_add_interface_static (gxml_xelement_type_id, GXML_TYPE_ELEMENT, &gxml_element_info);
		g_once_init_leave (&gxml_xelement_type_id__volatile, gxml_xelement_type_id);
	}
	return gxml_xelement_type_id__volatile;
}


static void _vala_gxml_xelement_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GXmlxElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XELEMENT, GXmlxElement);
	switch (property_id) {
		case GXML_XELEMENT_TAG_NAME:
		g_value_take_string (value, gxml_element_get_tag_name ((GXmlElement*) self));
		break;
		case GXML_XELEMENT_NODE_VALUE:
		g_value_set_string (value, gxml_xnode_get_node_value ((GXmlxNode*) self));
		break;
		case GXML_XELEMENT_ATTRIBUTES:
		g_value_set_object (value, gxml_xnode_get_attributes ((GXmlxNode*) self));
		break;
		case GXML_XELEMENT_CONTENT:
		g_value_take_string (value, gxml_element_get_content ((GXmlElement*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gxml_xelement_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GXmlxElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XELEMENT, GXmlxElement);
	switch (property_id) {
		case GXML_XELEMENT_NODE_VALUE:
		gxml_xnode_set_node_value ((GXmlxNode*) self, g_value_get_string (value));
		break;
		case GXML_XELEMENT_ATTRIBUTES:
		gxml_xnode_set_attributes ((GXmlxNode*) self, g_value_get_object (value));
		break;
		case GXML_XELEMENT_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;
	}
}



