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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 0; tab-width: 2 -*- */
/* GXmlHashMapAttr.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 "gxml/gxml.h"
#include <libxml/tree.h>
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <libxml/parser.h>
#include "gxml.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GXML_XHASH_MAP_ATTR_0_PROPERTY,
	GXML_XHASH_MAP_ATTR_ENTRIES_PROPERTY,
	GXML_XHASH_MAP_ATTR_KEYS_PROPERTY,
	GXML_XHASH_MAP_ATTR_READ_ONLY_PROPERTY,
	GXML_XHASH_MAP_ATTR_SIZE_PROPERTY,
	GXML_XHASH_MAP_ATTR_VALUES_PROPERTY,
	GXML_XHASH_MAP_ATTR_LENGTH_PROPERTY,
	GXML_XHASH_MAP_ATTR_NUM_PROPERTIES
};
static GParamSpec* gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GXML_XHASH_MAP_ATTR_ENTRY_0_PROPERTY,
	GXML_XHASH_MAP_ATTR_ENTRY_KEY_PROPERTY,
	GXML_XHASH_MAP_ATTR_ENTRY_READ_ONLY_PROPERTY,
	GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY,
	GXML_XHASH_MAP_ATTR_ENTRY_NUM_PROPERTIES
};
static GParamSpec* gxml_xhash_map_attr_entry_properties[GXML_XHASH_MAP_ATTR_ENTRY_NUM_PROPERTIES];
enum  {
	GXML_XHASH_MAP_ATTR_ITERATOR_0_PROPERTY,
	GXML_XHASH_MAP_ATTR_ITERATOR_MUTABLE_PROPERTY,
	GXML_XHASH_MAP_ATTR_ITERATOR_READ_ONLY_PROPERTY,
	GXML_XHASH_MAP_ATTR_ITERATOR_VALID_PROPERTY,
	GXML_XHASH_MAP_ATTR_ITERATOR_NUM_PROPERTIES
};
static GParamSpec* gxml_xhash_map_attr_iterator_properties[GXML_XHASH_MAP_ATTR_ITERATOR_NUM_PROPERTIES];

struct _GXmlXHashMapAttrPrivate {
	GXmlXDocument* _doc;
	xmlNode* _node;
};

struct _GXmlXHashMapAttrEntryPrivate {
	GXmlXDocument* _doc;
	xmlAttr* _attr;
	GXmlXAttribute* oattr;
};

struct _GXmlXHashMapAttrIteratorPrivate {
	GXmlXDocument* _doc;
	xmlNode* _node;
	xmlAttr* _current;
};

static gint GXmlXHashMapAttr_private_offset;
static gpointer gxml_xhash_map_attr_parent_class = NULL;
static gint GXmlXHashMapAttrEntry_private_offset;
static gpointer gxml_xhash_map_attr_entry_parent_class = NULL;
static gint GXmlXHashMapAttrIterator_private_offset;
static gpointer gxml_xhash_map_attr_iterator_parent_class = NULL;
static GeeMapIteratorIface * gxml_xhash_map_attr_iterator_gee_map_iterator_parent_iface = NULL;
static GXmlDomNamedNodeMapIface * gxml_xhash_map_attr_gxml_dom_named_node_map_parent_iface = NULL;

static void gxml_xhash_map_attr_real_clear (GeeAbstractMap* base);
static GXmlXNode* gxml_xhash_map_attr_real_get (GeeAbstractMap* base,
                                         const gchar* key);
static gboolean gxml_xhash_map_attr_real_has (GeeAbstractMap* base,
                                       const gchar* key,
                                       GXmlXNode* value);
static gboolean gxml_xhash_map_attr_real_has_key (GeeAbstractMap* base,
                                           const gchar* key);
static GeeMapIterator* gxml_xhash_map_attr_real_map_iterator (GeeAbstractMap* base);
static void gxml_xhash_map_attr_real_set (GeeAbstractMap* base,
                                   const gchar* key,
                                   GXmlXNode* value);
static gboolean gxml_xhash_map_attr_real_unset (GeeAbstractMap* base,
                                         const gchar* key,
                                         GXmlXNode** value);
static GXmlDomNode* gxml_xhash_map_attr_real_get_named_item (GXmlDomNamedNodeMap* base,
                                                      const gchar* name);
static GXmlDomNode* gxml_xhash_map_attr_real_item (GXmlDomNamedNodeMap* base,
                                            gint index);
static GXmlDomNode* gxml_xhash_map_attr_real_set_named_item (GXmlDomNamedNodeMap* base,
                                                      GXmlDomNode* node,
                                                      GError** error);
static GXmlDomNode* gxml_xhash_map_attr_real_remove_named_item (GXmlDomNamedNodeMap* base,
                                                         const gchar* name,
                                                         GError** error);
static GXmlDomNode* gxml_xhash_map_attr_real_get_named_item_ns (GXmlDomNamedNodeMap* base,
                                                         const gchar* namespace_uri,
                                                         const gchar* local_name,
                                                         GError** error);
static GXmlDomNode* gxml_xhash_map_attr_real_set_named_item_ns (GXmlDomNamedNodeMap* base,
                                                         GXmlDomNode* node,
                                                         GError** error);
static GXmlDomNode* gxml_xhash_map_attr_real_remove_named_item_ns (GXmlDomNamedNodeMap* base,
                                                            const gchar* namespace_uri,
                                                            const gchar* local_name,
                                                            GError** error);
static void gxml_xhash_map_attr_entry_finalize (GObject * obj);
static GType gxml_xhash_map_attr_entry_get_type_once (void);
static void _vala_gxml_xhash_map_attr_entry_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_gxml_xhash_map_attr_entry_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);
static gchar* gxml_xhash_map_attr_iterator_real_get_key (GeeMapIterator* base);
static GXmlXNode* gxml_xhash_map_attr_iterator_real_get_value (GeeMapIterator* base);
static gboolean gxml_xhash_map_attr_iterator_real_has_next (GeeMapIterator* base);
static gboolean gxml_xhash_map_attr_iterator_real_next (GeeMapIterator* base);
static void gxml_xhash_map_attr_iterator_real_set_value (GeeMapIterator* base,
                                                  GXmlXNode* value);
static void gxml_xhash_map_attr_iterator_real_unset (GeeMapIterator* base);
static void gxml_xhash_map_attr_iterator_finalize (GObject * obj);
static GType gxml_xhash_map_attr_iterator_get_type_once (void);
static void _vala_gxml_xhash_map_attr_iterator_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void gxml_xhash_map_attr_finalize (GObject * obj);
static GType gxml_xhash_map_attr_get_type_once (void);
static void _vala_gxml_xhash_map_attr_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gxml_xhash_map_attr_get_instance_private (GXmlXHashMapAttr* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlXHashMapAttr_private_offset);
}

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

GXmlXHashMapAttr*
gxml_xhash_map_attr_construct (GType object_type,
                               GXmlXDocument* doc,
                               xmlNode* node)
{
	GXmlXHashMapAttr * self = NULL;
	GXmlXDocument* _tmp0_;
	g_return_val_if_fail (doc != NULL, NULL);
	self = (GXmlXHashMapAttr*) gee_abstract_map_construct (object_type, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GXML_TYPE_XNODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	self->priv->_node = node;
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp0_;
	return self;
}

GXmlXHashMapAttr*
gxml_xhash_map_attr_new (GXmlXDocument* doc,
                         xmlNode* node)
{
	return gxml_xhash_map_attr_construct (GXML_TYPE_XHASH_MAP_ATTR, doc, node);
}

static void
gxml_xhash_map_attr_real_clear (GeeAbstractMap* base)
{
	GXmlXHashMapAttr * self;
	xmlNode* _tmp0_;
	xmlAttr* p = NULL;
	xmlNode* _tmp1_;
	xmlAttr* _tmp2_;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->properties;
	p = _tmp2_;
	while (TRUE) {
		xmlAttr* _tmp3_;
		xmlAttr* pn = NULL;
		xmlAttr* _tmp4_;
		xmlAttr* _tmp5_;
		xmlAttr* _tmp6_;
		xmlAttr* _tmp7_;
		_tmp3_ = p;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = p;
		pn = _tmp4_;
		_tmp5_ = p;
		_tmp6_ = _tmp5_->next;
		p = _tmp6_;
		_tmp7_ = pn;
		xmlRemoveProp (_tmp7_);
	}
}

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

static GXmlXNode*
gxml_xhash_map_attr_real_get (GeeAbstractMap* base,
                              const gchar* key)
{
	GXmlXHashMapAttr * self;
	GXmlXNode* nullnode = NULL;
	xmlNode* _tmp0_;
	xmlAttr* p = NULL;
	xmlNode* _tmp27_;
	xmlAttr* _tmp28_;
	xmlAttr* _tmp29_;
	xmlAttr* _tmp30_;
	xmlNs* _tmp31_;
	GXmlXDocument* _tmp38_;
	xmlAttr* _tmp39_;
	GXmlXAttribute* _tmp40_;
	GXmlXNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (key != NULL, NULL);
	nullnode = NULL;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = nullnode;
		return result;
	}
	if (string_contains (key, ":")) {
		gchar** pp = NULL;
		gchar** _tmp1_;
		gchar** _tmp2_;
		gint pp_length1;
		gint _pp_size_;
		gchar** _tmp3_;
		gint _tmp3__length1;
		xmlAttr* ps = NULL;
		xmlNode* _tmp4_;
		xmlAttr* _tmp5_;
		gchar* prefix = NULL;
		gchar** _tmp6_;
		gint _tmp6__length1;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* n = NULL;
		gchar** _tmp9_;
		gint _tmp9__length1;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp2_ = _tmp1_ = g_strsplit (key, ":", 0);
		pp = _tmp2_;
		pp_length1 = _vala_array_length (_tmp1_);
		_pp_size_ = pp_length1;
		_tmp3_ = pp;
		_tmp3__length1 = pp_length1;
		if (_tmp3__length1 != 2) {
			result = nullnode;
			pp = (_vala_array_free (pp, pp_length1, (GDestroyNotify) g_free), NULL);
			return result;
		}
		_tmp4_ = self->priv->_node;
		_tmp5_ = _tmp4_->properties;
		ps = _tmp5_;
		_tmp6_ = pp;
		_tmp6__length1 = pp_length1;
		_tmp7_ = _tmp6_[0];
		_tmp8_ = g_strdup (_tmp7_);
		prefix = _tmp8_;
		_tmp9_ = pp;
		_tmp9__length1 = pp_length1;
		_tmp10_ = _tmp9_[1];
		_tmp11_ = g_strdup (_tmp10_);
		n = _tmp11_;
		while (TRUE) {
			xmlAttr* _tmp12_;
			xmlAttr* _tmp13_;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			xmlAttr* _tmp25_;
			xmlAttr* _tmp26_;
			_tmp12_ = ps;
			if (!(_tmp12_ != NULL)) {
				break;
			}
			_tmp13_ = ps;
			_tmp14_ = _tmp13_->name;
			_tmp15_ = n;
			if (g_strcmp0 (_tmp14_, _tmp15_) == 0) {
				xmlAttr* _tmp16_;
				xmlNs* _tmp17_;
				xmlAttr* _tmp18_;
				xmlNs* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp21_;
				_tmp16_ = ps;
				_tmp17_ = _tmp16_->ns;
				if (_tmp17_ == NULL) {
					continue;
				}
				_tmp18_ = ps;
				_tmp19_ = _tmp18_->ns;
				_tmp20_ = _tmp19_->prefix;
				_tmp21_ = prefix;
				if (g_strcmp0 (_tmp20_, _tmp21_) == 0) {
					GXmlXDocument* _tmp22_;
					xmlAttr* _tmp23_;
					GXmlXAttribute* _tmp24_;
					_tmp22_ = self->priv->_doc;
					_tmp23_ = ps;
					_tmp24_ = gxml_xattribute_new (_tmp22_, _tmp23_);
					result = (GXmlXNode*) _tmp24_;
					_g_free0 (n);
					_g_free0 (prefix);
					pp = (_vala_array_free (pp, pp_length1, (GDestroyNotify) g_free), NULL);
					_g_object_unref0 (nullnode);
					return result;
				}
			}
			_tmp25_ = ps;
			_tmp26_ = _tmp25_->next;
			ps = _tmp26_;
		}
		_g_free0 (n);
		_g_free0 (prefix);
		pp = (_vala_array_free (pp, pp_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp27_ = self->priv->_node;
	_tmp28_ = xmlHasProp (_tmp27_, (xmlChar*) key);
	p = _tmp28_;
	_tmp29_ = p;
	if (_tmp29_ == NULL) {
		result = nullnode;
		return result;
	}
	_tmp30_ = p;
	_tmp31_ = _tmp30_->ns;
	if (_tmp31_ != NULL) {
		xmlAttr* npns = NULL;
		xmlNode* _tmp32_;
		xmlAttr* _tmp33_;
		xmlAttr* _tmp34_;
		_tmp32_ = self->priv->_node;
		_tmp33_ = xmlHasNsProp (_tmp32_, (xmlChar*) key, (xmlChar*) NULL);
		npns = _tmp33_;
		_tmp34_ = npns;
		if (_tmp34_ != NULL) {
			GXmlXDocument* _tmp35_;
			xmlAttr* _tmp36_;
			GXmlXAttribute* _tmp37_;
			_tmp35_ = self->priv->_doc;
			_tmp36_ = npns;
			_tmp37_ = gxml_xattribute_new (_tmp35_, _tmp36_);
			result = (GXmlXNode*) _tmp37_;
			_g_object_unref0 (nullnode);
			return result;
		}
	}
	_tmp38_ = self->priv->_doc;
	_tmp39_ = p;
	_tmp40_ = gxml_xattribute_new (_tmp38_, _tmp39_);
	result = (GXmlXNode*) _tmp40_;
	_g_object_unref0 (nullnode);
	return result;
}

static gboolean
gxml_xhash_map_attr_real_has (GeeAbstractMap* base,
                              const gchar* key,
                              GXmlXNode* value)
{
	GXmlXHashMapAttr * self;
	gboolean result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (key != NULL, FALSE);
	g_return_val_if_fail (value != NULL, FALSE);
	result = gee_abstract_map_has_key ((GeeAbstractMap*) self, key);
	return result;
}

static gboolean
gxml_xhash_map_attr_real_has_key (GeeAbstractMap* base,
                                  const gchar* key)
{
	GXmlXHashMapAttr * self;
	xmlNode* _tmp0_;
	xmlAttr* p = NULL;
	xmlNode* _tmp1_;
	xmlAttr* _tmp2_;
	gboolean result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (key != NULL, FALSE);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->properties;
	p = _tmp2_;
	while (TRUE) {
		xmlAttr* _tmp3_;
		xmlAttr* _tmp4_;
		const gchar* _tmp5_;
		xmlAttr* _tmp6_;
		xmlAttr* _tmp7_;
		_tmp3_ = p;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = p;
		_tmp5_ = _tmp4_->name;
		if (g_strcmp0 (_tmp5_, key) == 0) {
			result = TRUE;
			return result;
		}
		_tmp6_ = p;
		_tmp7_ = _tmp6_->next;
		p = _tmp7_;
	}
	result = FALSE;
	return result;
}

static GeeMapIterator*
gxml_xhash_map_attr_real_map_iterator (GeeAbstractMap* base)
{
	GXmlXHashMapAttr * self;
	GXmlXDocument* _tmp0_;
	xmlNode* _tmp1_;
	GXmlXHashMapAttrIterator* _tmp2_;
	GeeMapIterator* result;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xhash_map_attr_iterator_new (_tmp0_, _tmp1_);
	result = (GeeMapIterator*) _tmp2_;
	return result;
}

static void
gxml_xhash_map_attr_real_set (GeeAbstractMap* base,
                              const gchar* key,
                              GXmlXNode* value)
{
	GXmlXHashMapAttr * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = (GXmlXHashMapAttr*) base;
	g_return_if_fail (key != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xnode_get_value (value);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	xmlNewProp (_tmp1_, (xmlChar*) key, (xmlChar*) _tmp4_);
	_g_free0 (_tmp4_);
}

static gboolean
gxml_xhash_map_attr_real_unset (GeeAbstractMap* base,
                                const gchar* key,
                                GXmlXNode** value)
{
	GXmlXHashMapAttr * self;
	GXmlXNode* _vala_value = NULL;
	xmlNode* _tmp0_;
	xmlAttr* p = NULL;
	xmlNode* _tmp1_;
	xmlAttr* _tmp2_;
	xmlAttr* _tmp3_;
	xmlAttr* _tmp4_;
	gboolean result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (key != NULL, FALSE);
	_g_object_unref0 (_vala_value);
	_vala_value = NULL;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		if (value) {
			*value = _vala_value;
		} else {
			_g_object_unref0 (_vala_value);
		}
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = xmlHasProp (_tmp1_, (xmlChar*) key);
	p = _tmp2_;
	_tmp3_ = p;
	if (_tmp3_ == NULL) {
		result = FALSE;
		if (value) {
			*value = _vala_value;
		} else {
			_g_object_unref0 (_vala_value);
		}
		return result;
	}
	_tmp4_ = p;
	xmlRemoveProp (_tmp4_);
	result = TRUE;
	if (value) {
		*value = _vala_value;
	} else {
		_g_object_unref0 (_vala_value);
	}
	return result;
}

static GeeSet*
gxml_xhash_map_attr_real_get_entries (GeeAbstractMap* base)
{
	GeeSet* result;
	GXmlXHashMapAttr* self;
	GeeHashSet* l = NULL;
	GeeHashSet* _tmp0_;
	xmlNode* _tmp1_;
	xmlAttr* p = NULL;
	xmlNode* _tmp2_;
	xmlAttr* _tmp3_;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = gee_hash_set_new (GXML_XHASH_MAP_ATTR_TYPE_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	l = _tmp0_;
	_tmp1_ = self->priv->_node;
	if (_tmp1_ == NULL) {
		result = (GeeSet*) l;
		return result;
	}
	_tmp2_ = self->priv->_node;
	_tmp3_ = _tmp2_->properties;
	p = _tmp3_;
	while (TRUE) {
		xmlAttr* _tmp4_;
		GXmlXHashMapAttrEntry* e = NULL;
		GXmlXDocument* _tmp5_;
		xmlAttr* _tmp6_;
		GXmlXHashMapAttrEntry* _tmp7_;
		GeeHashSet* _tmp8_;
		GXmlXHashMapAttrEntry* _tmp9_;
		xmlAttr* _tmp10_;
		xmlAttr* _tmp11_;
		_tmp4_ = p;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = self->priv->_doc;
		_tmp6_ = p;
		_tmp7_ = gxml_xhash_map_attr_entry_new (_tmp5_, _tmp6_);
		e = _tmp7_;
		_tmp8_ = l;
		_tmp9_ = e;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, _tmp9_);
		_tmp10_ = p;
		_tmp11_ = _tmp10_->next;
		p = _tmp11_;
		_g_object_unref0 (e);
	}
	result = (GeeSet*) l;
	return result;
}

static GeeSet*
gxml_xhash_map_attr_real_get_keys (GeeAbstractMap* base)
{
	GeeSet* result;
	GXmlXHashMapAttr* self;
	GeeHashSet* l = NULL;
	GeeHashSet* _tmp0_;
	xmlNode* _tmp1_;
	xmlAttr* p = NULL;
	xmlNode* _tmp2_;
	xmlAttr* _tmp3_;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	l = _tmp0_;
	_tmp1_ = self->priv->_node;
	if (_tmp1_ == NULL) {
		result = (GeeSet*) l;
		return result;
	}
	_tmp2_ = self->priv->_node;
	_tmp3_ = _tmp2_->properties;
	p = _tmp3_;
	while (TRUE) {
		xmlAttr* _tmp4_;
		GeeHashSet* _tmp5_;
		xmlAttr* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		xmlAttr* _tmp10_;
		xmlAttr* _tmp11_;
		_tmp4_ = p;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = l;
		_tmp6_ = p;
		_tmp7_ = _tmp6_->name;
		_tmp8_ = g_strdup (_tmp7_);
		_tmp9_ = _tmp8_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp9_);
		_g_free0 (_tmp9_);
		_tmp10_ = p;
		_tmp11_ = _tmp10_->next;
		p = _tmp11_;
	}
	result = (GeeSet*) l;
	return result;
}

static gboolean
gxml_xhash_map_attr_real_get_read_only (GeeAbstractMap* base)
{
	gboolean result;
	GXmlXHashMapAttr* self;
	self = (GXmlXHashMapAttr*) base;
	result = FALSE;
	return result;
}

static gint
gxml_xhash_map_attr_real_get_size (GeeAbstractMap* base)
{
	gint result;
	GXmlXHashMapAttr* self;
	xmlAttr* p = NULL;
	xmlNode* _tmp0_;
	xmlAttr* _tmp1_;
	gint i = 0;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = self->priv->_node;
	_tmp1_ = _tmp0_->properties;
	p = _tmp1_;
	i = 0;
	while (TRUE) {
		xmlAttr* _tmp2_;
		xmlAttr* _tmp3_;
		xmlAttr* _tmp4_;
		gint _tmp5_;
		_tmp2_ = p;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = p;
		_tmp4_ = _tmp3_->next;
		p = _tmp4_;
		_tmp5_ = i;
		i = _tmp5_ + 1;
	}
	result = i;
	return result;
}

static GeeCollection*
gxml_xhash_map_attr_real_get_values (GeeAbstractMap* base)
{
	GeeCollection* result;
	GXmlXHashMapAttr* self;
	GeeArrayList* l = NULL;
	GeeArrayList* _tmp0_;
	xmlAttr* p = NULL;
	xmlNode* _tmp1_;
	xmlAttr* _tmp2_;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = gee_array_list_new (GXML_TYPE_XNODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	l = _tmp0_;
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->properties;
	p = _tmp2_;
	while (TRUE) {
		xmlAttr* _tmp3_;
		GeeArrayList* _tmp4_;
		GXmlXDocument* _tmp5_;
		xmlAttr* _tmp6_;
		GXmlXAttribute* _tmp7_;
		GXmlXAttribute* _tmp8_;
		xmlAttr* _tmp9_;
		xmlAttr* _tmp10_;
		_tmp3_ = p;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = l;
		_tmp5_ = self->priv->_doc;
		_tmp6_ = p;
		_tmp7_ = gxml_xattribute_new (_tmp5_, _tmp6_);
		_tmp8_ = _tmp7_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, (GXmlXNode*) _tmp8_);
		_g_object_unref0 (_tmp8_);
		_tmp9_ = p;
		_tmp10_ = _tmp9_->next;
		p = _tmp10_;
	}
	result = (GeeCollection*) l;
	return result;
}

static gint
gxml_xhash_map_attr_real_get_length (GXmlDomNamedNodeMap* base)
{
	gint result;
	GXmlXHashMapAttr* self;
	gint _tmp0_;
	gint _tmp1_;
	self = (GXmlXHashMapAttr*) base;
	_tmp0_ = gee_abstract_map_get_size ((GeeAbstractMap*) self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_get_named_item (GXmlDomNamedNodeMap* base,
                                         const gchar* name)
{
	GXmlXHashMapAttr * self;
	gpointer _tmp0_;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) self, name);
	result = G_TYPE_CHECK_INSTANCE_CAST ((GXmlXNode*) _tmp0_, GXML_TYPE_DOM_NODE, GXmlDomNode);
	return result;
}

/**
   * Search items in this collection and return the object found at
   * index, but not order is warrantied
   *
   * If index is greater than collection size, then last element found
   * is returned. This function falls back to first element found on any
   * issue.
   *
   * @param index of required {@link DomNode}
   */
static GXmlDomNode*
gxml_xhash_map_attr_real_item (GXmlDomNamedNodeMap* base,
                               gint index)
{
	GXmlXHashMapAttr * self;
	gint i = 0;
	gint _tmp0_;
	gint _tmp1_;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	i = 0;
	_tmp0_ = gee_abstract_map_get_size ((GeeAbstractMap*) self);
	_tmp1_ = _tmp0_;
	if (index > _tmp1_) {
		result = NULL;
		return result;
	}
	{
		GeeIterator* _node_it = NULL;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp2_ = gee_abstract_map_get_values ((GeeAbstractMap*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_node_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			GXmlXNode* node = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			_tmp7_ = _node_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _node_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			node = (GXmlXNode*) _tmp9_;
			if (i == index) {
				GXmlXNode* _tmp10_;
				GXmlDomNode* _tmp11_;
				_tmp10_ = node;
				_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GXML_TYPE_DOM_NODE, GXmlDomNode));
				result = _tmp11_;
				_g_object_unref0 (node);
				_g_object_unref0 (_node_it);
				return result;
			}
			_g_object_unref0 (node);
		}
		_g_object_unref0 (_node_it);
	}
	result = NULL;
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_set_named_item (GXmlDomNamedNodeMap* base,
                                         GXmlDomNode* node,
                                         GError** error)
{
	GXmlXHashMapAttr * self;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	GXmlDomElement* _parent = NULL;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	gpointer _tmp4_;
	GeeMapEntry* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GXmlDomNode* _tmp8_;
	GXmlDomNode* _tmp9_;
	GXmlDomElement* _tmp10_;
	GXmlDomElement* _tmp11_;
	gboolean _tmp12_ = FALSE;
	gint _tmp13_;
	gint _tmp14_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp24_ = FALSE;
	gboolean _tmp30_ = FALSE;
	GXmlDomElement* _tmp31_;
	GXmlDomElement* _tmp33_;
	GError* _inner_error0_ = NULL;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp1_ = _tmp0_;
	gee_iterator_next (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_iterator_get (_tmp3_);
	_tmp5_ = (GeeMapEntry*) _tmp4_;
	_tmp6_ = gee_map_entry_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = GXML_IS_DOM_ELEMENT (_tmp9_) ? ((GXmlDomElement*) _tmp9_) : NULL;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (_tmp9_);
	}
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_parent = _tmp11_;
	_tmp13_ = gee_abstract_map_get_size ((GeeAbstractMap*) self);
	_tmp14_ = _tmp13_;
	if (_tmp14_ > 0) {
		GXmlDomDocument* _tmp15_;
		GXmlDomDocument* _tmp16_;
		GXmlDomElement* _tmp17_;
		GXmlDomDocument* _tmp18_;
		GXmlDomDocument* _tmp19_;
		_tmp15_ = gxml_dom_node_get_owner_document (node);
		_tmp16_ = _tmp15_;
		_tmp17_ = _parent;
		_tmp18_ = gxml_dom_node_get_owner_document ((GXmlDomNode*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp12_ = _tmp16_ != _tmp19_;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		GError* _tmp20_;
		_tmp20_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_WRONG_DOCUMENT_ERROR, _ ("Invalid document when adding item to collection"));
		_inner_error0_ = _tmp20_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp21_ = gee_abstract_map_get_read_only ((GeeAbstractMap*) self);
	_tmp22_ = _tmp21_;
	if (_tmp22_) {
		GError* _tmp23_;
		_tmp23_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NO_MODIFICATION_ALLOWED_ERROR, _ ("This node collection is read only"));
		_inner_error0_ = _tmp23_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	if (GXML_IS_DOM_ATTR (node)) {
		GXmlDomElement* _tmp25_;
		GXmlDomNode* _tmp26_;
		GXmlDomNode* _tmp27_;
		GXmlDomNode* _tmp28_;
		_tmp25_ = _parent;
		_tmp26_ = gxml_dom_node_get_parent_node (node);
		_tmp27_ = _tmp26_;
		_tmp28_ = _tmp27_;
		_tmp24_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GXML_TYPE_DOM_NODE, GXmlDomNode) != _tmp28_;
		_g_object_unref0 (_tmp28_);
	} else {
		_tmp24_ = FALSE;
	}
	if (_tmp24_) {
		GError* _tmp29_;
		_tmp29_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_INUSE_ATTRIBUTE_ERROR, _ ("This node attribute is already in use by other Element"));
		_inner_error0_ = _tmp29_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp31_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp31_)) {
		_tmp30_ = !GXML_IS_DOM_ATTR (node);
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		GError* _tmp32_;
		_tmp32_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_HIERARCHY_REQUEST_ERROR, _ ("Trying to add an object to an Element, but it is not an attribute"));
		_inner_error0_ = _tmp32_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp33_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp33_)) {
		GXmlDomElement* _tmp34_;
		gchar* _tmp35_;
		gchar* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		GXmlDomNode* _tmp41_;
		_tmp34_ = _parent;
		_tmp35_ = gxml_dom_node_get_node_name (node);
		_tmp36_ = _tmp35_;
		_tmp37_ = _tmp36_;
		_tmp38_ = gxml_dom_node_get_node_value (node);
		_tmp39_ = _tmp38_;
		_tmp40_ = _tmp39_;
		gxml_dom_element_set_attribute (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement), _tmp37_, _tmp40_, &_inner_error0_);
		_g_free0 (_tmp40_);
		_g_free0 (_tmp37_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (_parent);
			return NULL;
		}
		_tmp41_ = _g_object_ref0 (node);
		result = _tmp41_;
		_g_object_unref0 (_parent);
		return result;
	}
	result = NULL;
	_g_object_unref0 (_parent);
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_remove_named_item (GXmlDomNamedNodeMap* base,
                                            const gchar* name,
                                            GError** error)
{
	GXmlXHashMapAttr * self;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	GXmlDomElement* _parent = NULL;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	gpointer _tmp4_;
	GeeMapEntry* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GXmlDomNode* _tmp8_;
	GXmlDomNode* _tmp9_;
	GXmlDomElement* _tmp10_;
	GXmlDomElement* _tmp11_;
	GXmlXNode* n = NULL;
	gpointer _tmp12_;
	GXmlXNode* _tmp13_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	GXmlDomElement* _tmp21_;
	GError* _inner_error0_ = NULL;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp1_ = _tmp0_;
	gee_iterator_next (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_iterator_get (_tmp3_);
	_tmp5_ = (GeeMapEntry*) _tmp4_;
	_tmp6_ = gee_map_entry_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = GXML_IS_DOM_ELEMENT (_tmp9_) ? ((GXmlDomElement*) _tmp9_) : NULL;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (_tmp9_);
	}
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_parent = _tmp11_;
	_tmp12_ = GEE_ABSTRACT_MAP_CLASS (gxml_xhash_map_attr_parent_class)->get (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), name);
	n = (GXmlXNode*) _tmp12_;
	_tmp13_ = n;
	if (_tmp13_ == NULL) {
		gchar* _tmp14_;
		gchar* _tmp15_;
		GError* _tmp16_;
		GError* _tmp17_;
		_tmp14_ = g_strdup_printf ("No node with name %s was found", name);
		_tmp15_ = _tmp14_;
		_tmp16_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NOT_FOUND_ERROR, _ (_tmp15_));
		_tmp17_ = _tmp16_;
		_g_free0 (_tmp15_);
		_inner_error0_ = _tmp17_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (n);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp18_ = gee_abstract_map_get_read_only ((GeeAbstractMap*) self);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GError* _tmp20_;
		_tmp20_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NO_MODIFICATION_ALLOWED_ERROR, _ ("Node collection is read only"));
		_inner_error0_ = _tmp20_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (n);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp21_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp21_)) {
		GXmlDomNode* a = NULL;
		GXmlDomElement* _tmp22_;
		GXmlDomNamedNodeMap* _tmp23_;
		GXmlDomNamedNodeMap* _tmp24_;
		GXmlDomNamedNodeMap* _tmp25_;
		GXmlDomNode* _tmp26_;
		GXmlDomNode* _tmp27_;
		GXmlDomElement* _tmp28_;
		xmlNode* _tmp29_;
		_tmp22_ = _parent;
		_tmp23_ = gxml_dom_element_get_attributes (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = _tmp24_;
		_tmp26_ = gxml_dom_named_node_map_get_named_item (_tmp25_, name);
		_tmp27_ = _tmp26_;
		_g_object_unref0 (_tmp25_);
		a = _tmp27_;
		_tmp28_ = _parent;
		_tmp29_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GXML_TYPE_XNODE, GXmlXNode));
		xmlSetProp (_tmp29_, (xmlChar*) name, (xmlChar*) NULL);
		result = a;
		_g_object_unref0 (n);
		_g_object_unref0 (_parent);
		return result;
	}
	result = NULL;
	_g_object_unref0 (n);
	_g_object_unref0 (_parent);
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_get_named_item_ns (GXmlDomNamedNodeMap* base,
                                            const gchar* namespace_uri,
                                            const gchar* local_name,
                                            GError** error)
{
	GXmlXHashMapAttr * self;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (namespace_uri != NULL, NULL);
	g_return_val_if_fail (local_name != NULL, NULL);
	{
		GeeIterator* _n_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = gee_abstract_map_get_values ((GeeAbstractMap*) self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_n_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			GXmlDomNode* n = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			gchar* uri = NULL;
			gchar* _tmp8_;
			gboolean _tmp9_ = FALSE;
			GXmlDomNode* _tmp10_;
			GXmlDomNode* _tmp12_;
			GXmlDomNode* _tmp21_;
			gboolean _tmp30_ = FALSE;
			const gchar* _tmp31_;
			_tmp5_ = _n_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _n_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			n = (GXmlDomNode*) ((GXmlXNode*) _tmp7_);
			_tmp8_ = g_strdup ("");
			uri = _tmp8_;
			_tmp10_ = n;
			if (GXML_IS_DOM_ELEMENT (_tmp10_)) {
				_tmp9_ = TRUE;
			} else {
				GXmlDomNode* _tmp11_;
				_tmp11_ = n;
				_tmp9_ = GXML_IS_DOM_ATTR (_tmp11_);
			}
			if (!_tmp9_) {
				_g_free0 (uri);
				_g_object_unref0 (n);
				continue;
			}
			_tmp12_ = n;
			if (GXML_IS_DOM_ELEMENT (_tmp12_)) {
				GXmlDomNode* _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				gboolean _tmp17_;
				GXmlDomNode* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				_tmp13_ = n;
				_tmp14_ = gxml_dom_element_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement));
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = _tmp16_ == NULL;
				_g_free0 (_tmp16_);
				if (_tmp17_) {
					_g_free0 (uri);
					_g_object_unref0 (n);
					continue;
				}
				_tmp18_ = n;
				_tmp19_ = gxml_dom_element_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement));
				_tmp20_ = _tmp19_;
				_g_free0 (uri);
				uri = _tmp20_;
			}
			_tmp21_ = n;
			if (GXML_IS_DOM_ATTR (_tmp21_)) {
				GXmlDomNode* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				gboolean _tmp26_;
				GXmlDomNode* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				_tmp22_ = n;
				_tmp23_ = gxml_dom_attr_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
				_tmp24_ = _tmp23_;
				_tmp25_ = _tmp24_;
				_tmp26_ = _tmp25_ == NULL;
				_g_free0 (_tmp25_);
				if (_tmp26_) {
					_g_free0 (uri);
					_g_object_unref0 (n);
					continue;
				}
				_tmp27_ = n;
				_tmp28_ = gxml_dom_attr_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
				_tmp29_ = _tmp28_;
				_g_free0 (uri);
				uri = _tmp29_;
			}
			_tmp31_ = uri;
			if (g_strcmp0 (_tmp31_, namespace_uri) == 0) {
				GXmlDomNode* _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				gchar* _tmp35_;
				_tmp32_ = n;
				_tmp33_ = gxml_dom_node_get_node_name (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = _tmp34_;
				_tmp30_ = g_strcmp0 (_tmp35_, local_name) == 0;
				_g_free0 (_tmp35_);
			} else {
				_tmp30_ = FALSE;
			}
			if (_tmp30_) {
				GXmlDomNode* _tmp36_;
				GXmlDomNode* _tmp37_;
				_tmp36_ = n;
				_tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GXML_TYPE_DOM_NODE, GXmlDomNode));
				result = _tmp37_;
				_g_free0 (uri);
				_g_object_unref0 (n);
				_g_object_unref0 (_n_it);
				return result;
			}
			_g_free0 (uri);
			_g_object_unref0 (n);
		}
		_g_object_unref0 (_n_it);
	}
	result = NULL;
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_set_named_item_ns (GXmlDomNamedNodeMap* base,
                                            GXmlDomNode* node,
                                            GError** error)
{
	GXmlXHashMapAttr * self;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	GXmlDomElement* _parent = NULL;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	gpointer _tmp4_;
	GeeMapEntry* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GXmlDomNode* _tmp8_;
	GXmlDomNode* _tmp9_;
	GXmlDomElement* _tmp10_;
	GXmlDomElement* _tmp11_;
	gboolean _tmp12_ = FALSE;
	gint _tmp13_;
	gint _tmp14_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp24_ = FALSE;
	gboolean _tmp30_ = FALSE;
	GXmlDomElement* _tmp31_;
	gboolean _tmp33_ = FALSE;
	GXmlDomElement* _tmp34_;
	GError* _inner_error0_ = NULL;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp1_ = _tmp0_;
	gee_iterator_next (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_iterator_get (_tmp3_);
	_tmp5_ = (GeeMapEntry*) _tmp4_;
	_tmp6_ = gee_map_entry_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = GXML_IS_DOM_ELEMENT (_tmp9_) ? ((GXmlDomElement*) _tmp9_) : NULL;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (_tmp9_);
	}
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_parent = _tmp11_;
	_tmp13_ = gee_abstract_map_get_size ((GeeAbstractMap*) self);
	_tmp14_ = _tmp13_;
	if (_tmp14_ > 0) {
		GXmlDomDocument* _tmp15_;
		GXmlDomDocument* _tmp16_;
		GXmlDomElement* _tmp17_;
		GXmlDomDocument* _tmp18_;
		GXmlDomDocument* _tmp19_;
		_tmp15_ = gxml_dom_node_get_owner_document (node);
		_tmp16_ = _tmp15_;
		_tmp17_ = _parent;
		_tmp18_ = gxml_dom_node_get_owner_document ((GXmlDomNode*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp12_ = _tmp16_ != _tmp19_;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		GError* _tmp20_;
		_tmp20_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_WRONG_DOCUMENT_ERROR, _ ("Invalid document when adding item to named node map collection"));
		_inner_error0_ = _tmp20_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp21_ = gee_abstract_map_get_read_only ((GeeAbstractMap*) self);
	_tmp22_ = _tmp21_;
	if (_tmp22_) {
		GError* _tmp23_;
		_tmp23_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NO_MODIFICATION_ALLOWED_ERROR, _ ("This node collection is read only"));
		_inner_error0_ = _tmp23_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	if (GXML_IS_DOM_ATTR (node)) {
		GXmlDomElement* _tmp25_;
		GXmlDomNode* _tmp26_;
		GXmlDomNode* _tmp27_;
		GXmlDomNode* _tmp28_;
		_tmp25_ = _parent;
		_tmp26_ = gxml_dom_node_get_parent_node (node);
		_tmp27_ = _tmp26_;
		_tmp28_ = _tmp27_;
		_tmp24_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GXML_TYPE_DOM_NODE, GXmlDomNode) != _tmp28_;
		_g_object_unref0 (_tmp28_);
	} else {
		_tmp24_ = FALSE;
	}
	if (_tmp24_) {
		GError* _tmp29_;
		_tmp29_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_INUSE_ATTRIBUTE_ERROR, _ ("This node attribute is already in use by other Element"));
		_inner_error0_ = _tmp29_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp31_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp31_)) {
		_tmp30_ = !GXML_IS_DOM_ATTR (node);
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		GError* _tmp32_;
		_tmp32_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_HIERARCHY_REQUEST_ERROR, _ ("Trying to add an object to an Element, but it is not an attribute"));
		_inner_error0_ = _tmp32_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp34_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp34_)) {
		_tmp33_ = GXML_IS_DOM_ATTR (node);
	} else {
		_tmp33_ = FALSE;
	}
	if (_tmp33_) {
		GXmlDomElement* _tmp35_;
		gchar* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		gchar* _tmp49_;
		gchar* _tmp50_;
		gchar* _tmp51_;
		GXmlDomNode* _tmp52_ = NULL;
		GXmlDomElement* _tmp53_;
		GXmlDomNamedNodeMap* _tmp54_;
		GXmlDomNamedNodeMap* _tmp55_;
		GXmlDomNamedNodeMap* _tmp56_;
		gchar* _tmp57_;
		gchar* _tmp58_;
		gchar* _tmp59_;
		gchar* _tmp60_;
		gchar* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		gchar* _tmp64_;
		gchar* _tmp65_;
		gchar* _tmp66_;
		gchar* _tmp67_;
		gchar* _tmp68_;
		gchar* _tmp69_;
		GXmlDomNode* _tmp70_;
		GXmlDomNode* _tmp71_;
		GXmlDomNode* _tmp72_;
		_tmp35_ = _parent;
		_tmp36_ = gxml_dom_attr_get_prefix (G_TYPE_CHECK_INSTANCE_CAST (node, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
		_tmp37_ = _tmp36_;
		_tmp38_ = _tmp37_;
		_tmp39_ = g_strconcat (_tmp38_, ":", NULL);
		_tmp40_ = _tmp39_;
		_tmp41_ = gxml_dom_attr_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (node, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
		_tmp42_ = _tmp41_;
		_tmp43_ = _tmp42_;
		_tmp44_ = g_strconcat (_tmp40_, _tmp43_, NULL);
		_tmp45_ = _tmp44_;
		_tmp46_ = gxml_dom_node_get_node_name (node);
		_tmp47_ = _tmp46_;
		_tmp48_ = _tmp47_;
		_tmp49_ = gxml_dom_node_get_node_value (node);
		_tmp50_ = _tmp49_;
		_tmp51_ = _tmp50_;
		gxml_dom_element_set_attribute_ns (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement), _tmp45_, _tmp48_, _tmp51_, &_inner_error0_);
		_g_free0 (_tmp51_);
		_g_free0 (_tmp48_);
		_g_free0 (_tmp45_);
		_g_free0 (_tmp43_);
		_g_free0 (_tmp40_);
		_g_free0 (_tmp38_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (_parent);
			return NULL;
		}
		_tmp53_ = _parent;
		_tmp54_ = gxml_dom_element_get_attributes (_tmp53_);
		_tmp55_ = _tmp54_;
		_tmp56_ = _tmp55_;
		_tmp57_ = gxml_dom_attr_get_prefix (G_TYPE_CHECK_INSTANCE_CAST (node, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
		_tmp58_ = _tmp57_;
		_tmp59_ = _tmp58_;
		_tmp60_ = g_strconcat (_tmp59_, ":", NULL);
		_tmp61_ = _tmp60_;
		_tmp62_ = gxml_dom_attr_get_namespace_uri (G_TYPE_CHECK_INSTANCE_CAST (node, GXML_TYPE_DOM_ATTR, GXmlDomAttr));
		_tmp63_ = _tmp62_;
		_tmp64_ = _tmp63_;
		_tmp65_ = g_strconcat (_tmp61_, _tmp64_, NULL);
		_tmp66_ = _tmp65_;
		_tmp67_ = gxml_dom_node_get_node_name (node);
		_tmp68_ = _tmp67_;
		_tmp69_ = _tmp68_;
		_tmp70_ = gxml_dom_named_node_map_get_named_item_ns (_tmp56_, _tmp66_, _tmp69_, &_inner_error0_);
		_tmp71_ = _tmp70_;
		_g_free0 (_tmp69_);
		_g_free0 (_tmp66_);
		_g_free0 (_tmp64_);
		_g_free0 (_tmp61_);
		_g_free0 (_tmp59_);
		_g_object_unref0 (_tmp56_);
		_tmp52_ = _tmp71_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (_parent);
			return NULL;
		}
		_tmp72_ = _tmp52_;
		_tmp52_ = NULL;
		result = _tmp72_;
		_g_object_unref0 (_tmp52_);
		_g_object_unref0 (_parent);
		return result;
	}
	result = NULL;
	_g_object_unref0 (_parent);
	return result;
}

static GXmlDomNode*
gxml_xhash_map_attr_real_remove_named_item_ns (GXmlDomNamedNodeMap* base,
                                               const gchar* namespace_uri,
                                               const gchar* local_name,
                                               GError** error)
{
	GXmlXHashMapAttr * self;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	GXmlDomElement* _parent = NULL;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	gpointer _tmp4_;
	GeeMapEntry* _tmp5_;
	gconstpointer _tmp6_;
	gconstpointer _tmp7_;
	GXmlDomNode* _tmp8_;
	GXmlDomNode* _tmp9_;
	GXmlDomElement* _tmp10_;
	GXmlDomElement* _tmp11_;
	GXmlDomElement* _tmp12_;
	GXmlDomNode* n = NULL;
	GXmlDomElement* _tmp13_;
	GXmlDomNamedNodeMap* _tmp14_;
	GXmlDomNamedNodeMap* _tmp15_;
	GXmlDomNamedNodeMap* _tmp16_;
	GXmlDomNode* _tmp17_;
	GXmlDomNode* _tmp18_;
	GXmlDomNode* _tmp19_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	GXmlDomElement* _tmp27_;
	GError* _inner_error0_ = NULL;
	GXmlDomNode* result;
	self = (GXmlXHashMapAttr*) base;
	g_return_val_if_fail (namespace_uri != NULL, NULL);
	g_return_val_if_fail (local_name != NULL, NULL);
	_tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp1_ = _tmp0_;
	gee_iterator_next (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = gee_iterable_iterator ((GeeIterable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_iterator_get (_tmp3_);
	_tmp5_ = (GeeMapEntry*) _tmp4_;
	_tmp6_ = gee_map_entry_get_value (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = GXML_IS_DOM_ELEMENT (_tmp9_) ? ((GXmlDomElement*) _tmp9_) : NULL;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (_tmp9_);
	}
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_parent = _tmp11_;
	_tmp12_ = _parent;
	if (!GXML_IS_DOM_ELEMENT (_tmp12_)) {
		result = NULL;
		_g_object_unref0 (_parent);
		return result;
	}
	_tmp13_ = _parent;
	_tmp14_ = gxml_dom_element_get_attributes (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_;
	_tmp17_ = gxml_dom_named_node_map_get_named_item_ns (_tmp16_, namespace_uri, local_name, &_inner_error0_);
	_tmp18_ = _tmp17_;
	_g_object_unref0 (_tmp16_);
	n = _tmp18_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp19_ = n;
	if (_tmp19_ == NULL) {
		gchar* _tmp20_;
		gchar* _tmp21_;
		GError* _tmp22_;
		GError* _tmp23_;
		_tmp20_ = g_strdup_printf ("No node with name %s was found", local_name);
		_tmp21_ = _tmp20_;
		_tmp22_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NOT_FOUND_ERROR, _ (_tmp21_));
		_tmp23_ = _tmp22_;
		_g_free0 (_tmp21_);
		_inner_error0_ = _tmp23_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (n);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp24_ = gee_abstract_map_get_read_only ((GeeAbstractMap*) self);
	_tmp25_ = _tmp24_;
	if (_tmp25_) {
		GError* _tmp26_;
		_tmp26_ = g_error_new_literal (GXML_DOM_ERROR, GXML_DOM_ERROR_NO_MODIFICATION_ALLOWED_ERROR, _ ("Node collection is read only"));
		_inner_error0_ = _tmp26_;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (n);
		_g_object_unref0 (_parent);
		return NULL;
	}
	_tmp27_ = _parent;
	if (GXML_IS_DOM_ELEMENT (_tmp27_)) {
		xmlNs* ns = NULL;
		GXmlDomElement* _tmp28_;
		xmlNode* _tmp29_;
		xmlDoc* _tmp30_;
		GXmlDomElement* _tmp31_;
		xmlNode* _tmp32_;
		xmlNs* _tmp33_;
		GXmlDomElement* _tmp34_;
		xmlNode* _tmp35_;
		xmlNs* _tmp36_;
		_tmp28_ = _parent;
		_tmp29_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GXML_TYPE_XNODE, GXmlXNode));
		_tmp30_ = _tmp29_->doc;
		_tmp31_ = _parent;
		_tmp32_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GXML_TYPE_XNODE, GXmlXNode));
		_tmp33_ = xmlSearchNsByHref (_tmp30_, _tmp32_, namespace_uri);
		ns = _tmp33_;
		_tmp34_ = _parent;
		_tmp35_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GXML_TYPE_XNODE, GXmlXNode));
		_tmp36_ = ns;
		xmlSetNsProp (_tmp35_, _tmp36_, (xmlChar*) local_name, (xmlChar*) NULL);
		result = n;
		_g_object_unref0 (_parent);
		return result;
	}
	result = NULL;
	_g_object_unref0 (n);
	_g_object_unref0 (_parent);
	return result;
}

static inline gpointer
gxml_xhash_map_attr_entry_get_instance_private (GXmlXHashMapAttrEntry* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlXHashMapAttrEntry_private_offset);
}

GXmlXHashMapAttrEntry*
gxml_xhash_map_attr_entry_construct (GType object_type,
                                     GXmlXDocument* doc,
                                     xmlAttr* attr)
{
	GXmlXHashMapAttrEntry * self = NULL;
	GXmlXDocument* _tmp0_;
	GXmlXDocument* _tmp1_;
	xmlAttr* _tmp2_;
	GXmlXAttribute* _tmp3_;
	g_return_val_if_fail (doc != NULL, NULL);
	self = (GXmlXHashMapAttrEntry*) gee_map_entry_construct (object_type, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GXML_TYPE_XNODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	self->priv->_attr = attr;
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp0_;
	_tmp1_ = self->priv->_doc;
	_tmp2_ = self->priv->_attr;
	_tmp3_ = gxml_xattribute_new (_tmp1_, _tmp2_);
	_g_object_unref0 (self->priv->oattr);
	self->priv->oattr = _tmp3_;
	return self;
}

GXmlXHashMapAttrEntry*
gxml_xhash_map_attr_entry_new (GXmlXDocument* doc,
                               xmlAttr* attr)
{
	return gxml_xhash_map_attr_entry_construct (GXML_XHASH_MAP_ATTR_TYPE_ENTRY, doc, attr);
}

static const gchar*
gxml_xhash_map_attr_entry_real_get_key (GeeMapEntry* base)
{
	const gchar* result;
	GXmlXHashMapAttrEntry* self;
	xmlAttr* _tmp0_;
	const gchar* _tmp1_;
	self = (GXmlXHashMapAttrEntry*) base;
	_tmp0_ = self->priv->_attr;
	_tmp1_ = _tmp0_->name;
	result = _tmp1_;
	return result;
}

static gboolean
gxml_xhash_map_attr_entry_real_get_read_only (GeeMapEntry* base)
{
	gboolean result;
	GXmlXHashMapAttrEntry* self;
	self = (GXmlXHashMapAttrEntry*) base;
	result = TRUE;
	return result;
}

static GXmlXNode*
gxml_xhash_map_attr_entry_real_get_value (GeeMapEntry* base)
{
	GXmlXNode* result;
	GXmlXHashMapAttrEntry* self;
	GXmlXAttribute* _tmp0_;
	self = (GXmlXHashMapAttrEntry*) base;
	_tmp0_ = self->priv->oattr;
	result = (GXmlXNode*) _tmp0_;
	return result;
}

static void
gxml_xhash_map_attr_entry_real_set_value (GeeMapEntry* base,
                                          GXmlXNode* value)
{
	GXmlXHashMapAttrEntry* self;
	self = (GXmlXHashMapAttrEntry*) base;
	g_object_notify_by_pspec ((GObject *) self, gxml_xhash_map_attr_entry_properties[GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY]);
}

static void
gxml_xhash_map_attr_entry_class_init (GXmlXHashMapAttrEntryClass * klass,
                                      gpointer klass_data)
{
	gxml_xhash_map_attr_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlXHashMapAttrEntry_private_offset);
	GEE_MAP_ENTRY_CLASS (klass)->get_key = (gconstpointer (*) (GeeMapEntry*)) gxml_xhash_map_attr_entry_real_get_key;
	GEE_MAP_ENTRY_CLASS (klass)->get_read_only = (gboolean (*) (GeeMapEntry*)) gxml_xhash_map_attr_entry_real_get_read_only;
	GEE_MAP_ENTRY_CLASS (klass)->get_value = (gconstpointer (*) (GeeMapEntry*)) gxml_xhash_map_attr_entry_real_get_value;
	GEE_MAP_ENTRY_CLASS (klass)->set_value = (void (*) (GeeMapEntry*, gconstpointer)) gxml_xhash_map_attr_entry_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xhash_map_attr_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_xhash_map_attr_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xhash_map_attr_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ENTRY_KEY_PROPERTY, gxml_xhash_map_attr_entry_properties[GXML_XHASH_MAP_ATTR_ENTRY_KEY_PROPERTY] = g_param_spec_string ("key", "key", "key", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ENTRY_READ_ONLY_PROPERTY, gxml_xhash_map_attr_entry_properties[GXML_XHASH_MAP_ATTR_ENTRY_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY, gxml_xhash_map_attr_entry_properties[GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY] = g_param_spec_object ("value", "value", "value", GXML_TYPE_XNODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_xhash_map_attr_entry_instance_init (GXmlXHashMapAttrEntry * self,
                                         gpointer klass)
{
	self->priv = gxml_xhash_map_attr_entry_get_instance_private (self);
}

static void
gxml_xhash_map_attr_entry_finalize (GObject * obj)
{
	GXmlXHashMapAttrEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_XHASH_MAP_ATTR_TYPE_ENTRY, GXmlXHashMapAttrEntry);
	_g_object_unref0 (self->priv->_doc);
	_g_object_unref0 (self->priv->oattr);
	G_OBJECT_CLASS (gxml_xhash_map_attr_entry_parent_class)->finalize (obj);
}

static GType
gxml_xhash_map_attr_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXHashMapAttrEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xhash_map_attr_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXHashMapAttrEntry), 0, (GInstanceInitFunc) gxml_xhash_map_attr_entry_instance_init, NULL };
	GType gxml_xhash_map_attr_entry_type_id;
	gxml_xhash_map_attr_entry_type_id = g_type_register_static (GEE_MAP_TYPE_ENTRY, "GXmlXHashMapAttrEntry", &g_define_type_info, 0);
	GXmlXHashMapAttrEntry_private_offset = g_type_add_instance_private (gxml_xhash_map_attr_entry_type_id, sizeof (GXmlXHashMapAttrEntryPrivate));
	return gxml_xhash_map_attr_entry_type_id;
}

GType
gxml_xhash_map_attr_entry_get_type (void)
{
	static volatile gsize gxml_xhash_map_attr_entry_type_id__once = 0;
	if (g_once_init_enter (&gxml_xhash_map_attr_entry_type_id__once)) {
		GType gxml_xhash_map_attr_entry_type_id;
		gxml_xhash_map_attr_entry_type_id = gxml_xhash_map_attr_entry_get_type_once ();
		g_once_init_leave (&gxml_xhash_map_attr_entry_type_id__once, gxml_xhash_map_attr_entry_type_id);
	}
	return gxml_xhash_map_attr_entry_type_id__once;
}

static void
_vala_gxml_xhash_map_attr_entry_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	GXmlXHashMapAttrEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_XHASH_MAP_ATTR_TYPE_ENTRY, GXmlXHashMapAttrEntry);
	switch (property_id) {
		case GXML_XHASH_MAP_ATTR_ENTRY_KEY_PROPERTY:
		g_value_set_string (value, (gchar*) gee_map_entry_get_key ((GeeMapEntry*) self));
		break;
		case GXML_XHASH_MAP_ATTR_ENTRY_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_map_entry_get_read_only ((GeeMapEntry*) self));
		break;
		case GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY:
		g_value_set_object (value, (GXmlXNode*) gee_map_entry_get_value ((GeeMapEntry*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_xhash_map_attr_entry_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	GXmlXHashMapAttrEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_XHASH_MAP_ATTR_TYPE_ENTRY, GXmlXHashMapAttrEntry);
	switch (property_id) {
		case GXML_XHASH_MAP_ATTR_ENTRY_VALUE_PROPERTY:
		gee_map_entry_set_value ((GeeMapEntry*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gxml_xhash_map_attr_iterator_get_instance_private (GXmlXHashMapAttrIterator* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlXHashMapAttrIterator_private_offset);
}

GXmlXHashMapAttrIterator*
gxml_xhash_map_attr_iterator_construct (GType object_type,
                                        GXmlXDocument* doc,
                                        xmlNode* node)
{
	GXmlXHashMapAttrIterator * self = NULL;
	GXmlXDocument* _tmp0_;
	g_return_val_if_fail (doc != NULL, NULL);
	self = (GXmlXHashMapAttrIterator*) g_object_new (object_type, NULL);
	self->priv->_node = node;
	self->priv->_current = NULL;
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp0_;
	return self;
}

GXmlXHashMapAttrIterator*
gxml_xhash_map_attr_iterator_new (GXmlXDocument* doc,
                                  xmlNode* node)
{
	return gxml_xhash_map_attr_iterator_construct (GXML_XHASH_MAP_ATTR_TYPE_ITERATOR, doc, node);
}

static gchar*
gxml_xhash_map_attr_iterator_real_get_key (GeeMapIterator* base)
{
	GXmlXHashMapAttrIterator * self;
	gchar* nullstr = NULL;
	xmlAttr* _tmp0_;
	gchar* result;
	self = (GXmlXHashMapAttrIterator*) base;
	nullstr = NULL;
	_tmp0_ = self->priv->_current;
	if (_tmp0_ != NULL) {
		xmlAttr* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp1_ = self->priv->_current;
		_tmp2_ = _tmp1_->name;
		_tmp3_ = g_strdup (_tmp2_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp4_);
	}
	result = nullstr;
	return result;
}

static GXmlXNode*
gxml_xhash_map_attr_iterator_real_get_value (GeeMapIterator* base)
{
	GXmlXHashMapAttrIterator * self;
	GXmlXDocument* _tmp0_;
	xmlAttr* _tmp1_;
	GXmlXAttribute* _tmp2_;
	GXmlXNode* result;
	self = (GXmlXHashMapAttrIterator*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_current;
	_tmp2_ = gxml_xattribute_new (_tmp0_, _tmp1_);
	result = (GXmlXNode*) _tmp2_;
	return result;
}

static gboolean
gxml_xhash_map_attr_iterator_real_has_next (GeeMapIterator* base)
{
	GXmlXHashMapAttrIterator * self;
	xmlNode* _tmp0_;
	xmlAttr* _tmp1_;
	xmlAttr* _tmp2_;
	gboolean result;
	self = (GXmlXHashMapAttrIterator*) base;
	_tmp0_ = self->priv->_node;
	_tmp1_ = _tmp0_->properties;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->priv->_current;
	if (_tmp2_ != NULL) {
		xmlAttr* _tmp3_;
		xmlAttr* _tmp4_;
		_tmp3_ = self->priv->_current;
		_tmp4_ = _tmp3_->next;
		if (_tmp4_ == NULL) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}

static gboolean
gxml_xhash_map_attr_iterator_real_next (GeeMapIterator* base)
{
	GXmlXHashMapAttrIterator * self;
	xmlNode* _tmp0_;
	xmlAttr* _tmp1_;
	xmlAttr* _tmp2_;
	xmlAttr* _tmp5_;
	xmlAttr* _tmp6_;
	xmlAttr* _tmp7_;
	xmlAttr* _tmp8_;
	gboolean result;
	self = (GXmlXHashMapAttrIterator*) base;
	_tmp0_ = self->priv->_node;
	_tmp1_ = _tmp0_->properties;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->priv->_current;
	if (_tmp2_ == NULL) {
		xmlNode* _tmp3_;
		xmlAttr* _tmp4_;
		_tmp3_ = self->priv->_node;
		_tmp4_ = _tmp3_->properties;
		self->priv->_current = _tmp4_;
	}
	_tmp5_ = self->priv->_current;
	_tmp6_ = _tmp5_->next;
	if (_tmp6_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp7_ = self->priv->_current;
	_tmp8_ = _tmp7_->next;
	self->priv->_current = _tmp8_;
	result = TRUE;
	return result;
}

static void
gxml_xhash_map_attr_iterator_real_set_value (GeeMapIterator* base,
                                             GXmlXNode* value)
{
	GXmlXHashMapAttrIterator * self;
	xmlAttr* _tmp0_;
	xmlAttr* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	self = (GXmlXHashMapAttrIterator*) base;
	g_return_if_fail (value != NULL);
	_tmp0_ = self->priv->_current;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_current;
	_tmp2_ = _tmp1_->name;
	_tmp3_ = gxml_xnode_get_name (value);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strcmp0 (_tmp2_, _tmp5_) == 0;
	_g_free0 (_tmp5_);
	if (_tmp6_) {
		xmlAttr* p = NULL;
		xmlNode* _tmp7_;
		xmlAttr* _tmp8_;
		_tmp7_ = self->priv->_node;
		_tmp8_ = _tmp7_->properties;
		p = _tmp8_;
		while (TRUE) {
			xmlAttr* _tmp9_;
			xmlAttr* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			gboolean _tmp15_;
			_tmp9_ = p;
			if (!(_tmp9_ != NULL)) {
				break;
			}
			_tmp10_ = p;
			_tmp11_ = _tmp10_->name;
			_tmp12_ = gxml_xnode_get_name (value);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = g_strcmp0 (_tmp11_, _tmp14_) == 0;
			_g_free0 (_tmp14_);
			if (_tmp15_) {
				xmlNode* _tmp16_;
				gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				_tmp16_ = self->priv->_node;
				_tmp17_ = gxml_xnode_get_name (value);
				_tmp18_ = _tmp17_;
				_tmp19_ = _tmp18_;
				_tmp20_ = gxml_xnode_get_value (value);
				_tmp21_ = _tmp20_;
				_tmp22_ = _tmp21_;
				xmlSetProp (_tmp16_, (xmlChar*) _tmp19_, (xmlChar*) _tmp22_);
				_g_free0 (_tmp22_);
				_g_free0 (_tmp19_);
			}
		}
	}
}

static void
gxml_xhash_map_attr_iterator_real_unset (GeeMapIterator* base)
{
	GXmlXHashMapAttrIterator * self;
	xmlAttr* _tmp0_;
	xmlNode* _tmp1_;
	xmlAttr* _tmp2_;
	const gchar* _tmp3_;
	self = (GXmlXHashMapAttrIterator*) base;
	_tmp0_ = self->priv->_current;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = self->priv->_current;
	_tmp3_ = _tmp2_->name;
	xmlSetProp (_tmp1_, (xmlChar*) _tmp3_, (xmlChar*) NULL);
}

static gboolean
gxml_xhash_map_attr_iterator_real_get_mutable (GeeMapIterator* base)
{
	gboolean result;
	GXmlXHashMapAttrIterator* self;
	self = (GXmlXHashMapAttrIterator*) base;
	result = FALSE;
	return result;
}

static gboolean
gxml_xhash_map_attr_iterator_real_get_read_only (GeeMapIterator* base)
{
	gboolean result;
	GXmlXHashMapAttrIterator* self;
	self = (GXmlXHashMapAttrIterator*) base;
	result = FALSE;
	return result;
}

static gboolean
gxml_xhash_map_attr_iterator_real_get_valid (GeeMapIterator* base)
{
	gboolean result;
	GXmlXHashMapAttrIterator* self;
	xmlAttr* _tmp0_;
	self = (GXmlXHashMapAttrIterator*) base;
	_tmp0_ = self->priv->_current;
	result = _tmp0_ != NULL;
	return result;
}

static void
gxml_xhash_map_attr_iterator_class_init (GXmlXHashMapAttrIteratorClass * klass,
                                         gpointer klass_data)
{
	gxml_xhash_map_attr_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlXHashMapAttrIterator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xhash_map_attr_iterator_get_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xhash_map_attr_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ITERATOR_MUTABLE_PROPERTY, gxml_xhash_map_attr_iterator_properties[GXML_XHASH_MAP_ATTR_ITERATOR_MUTABLE_PROPERTY] = g_param_spec_boolean ("mutable", "mutable", "mutable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ITERATOR_READ_ONLY_PROPERTY, gxml_xhash_map_attr_iterator_properties[GXML_XHASH_MAP_ATTR_ITERATOR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ITERATOR_VALID_PROPERTY, gxml_xhash_map_attr_iterator_properties[GXML_XHASH_MAP_ATTR_ITERATOR_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_type (GXmlXHashMapAttrIterator* self)
{
	return (GType) G_TYPE_STRING;
}

static GBoxedCopyFunc
gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_dup_func (GXmlXHashMapAttrIterator* self)
{
	return (GBoxedCopyFunc) g_strdup;
}

static GDestroyNotify
gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_destroy_func (GXmlXHashMapAttrIterator* self)
{
	return (GDestroyNotify) g_free;
}

static GType
gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_type (GXmlXHashMapAttrIterator* self)
{
	return (GType) GXML_TYPE_XNODE;
}

static GBoxedCopyFunc
gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_dup_func (GXmlXHashMapAttrIterator* self)
{
	return (GBoxedCopyFunc) g_object_ref;
}

static GDestroyNotify
gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_destroy_func (GXmlXHashMapAttrIterator* self)
{
	return (GDestroyNotify) g_object_unref;
}

static void
gxml_xhash_map_attr_iterator_gee_map_iterator_interface_init (GeeMapIteratorIface * iface,
                                                              gpointer iface_data)
{
	gxml_xhash_map_attr_iterator_gee_map_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_key = (gpointer (*) (GeeMapIterator*)) gxml_xhash_map_attr_iterator_real_get_key;
	iface->get_value = (gpointer (*) (GeeMapIterator*)) gxml_xhash_map_attr_iterator_real_get_value;
	iface->has_next = (gboolean (*) (GeeMapIterator*)) gxml_xhash_map_attr_iterator_real_has_next;
	iface->next = (gboolean (*) (GeeMapIterator*)) gxml_xhash_map_attr_iterator_real_next;
	iface->set_value = (void (*) (GeeMapIterator*, gconstpointer)) gxml_xhash_map_attr_iterator_real_set_value;
	iface->unset = (void (*) (GeeMapIterator*)) gxml_xhash_map_attr_iterator_real_unset;
	iface->get_k_type = (GType (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_type;
	iface->get_k_dup_func = (GBoxedCopyFunc (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_dup_func;
	iface->get_k_destroy_func = (GDestroyNotify (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_k_destroy_func;
	iface->get_v_type = (GType (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_type;
	iface->get_v_dup_func = (GBoxedCopyFunc (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_dup_func;
	iface->get_v_destroy_func = (GDestroyNotify (*) (GeeMapIterator *)) gxml_xhash_map_attr_iterator_gee_map_iterator_get_v_destroy_func;
	iface->get_mutable = gxml_xhash_map_attr_iterator_real_get_mutable;
	iface->get_read_only = gxml_xhash_map_attr_iterator_real_get_read_only;
	iface->get_valid = gxml_xhash_map_attr_iterator_real_get_valid;
}

static void
gxml_xhash_map_attr_iterator_instance_init (GXmlXHashMapAttrIterator * self,
                                            gpointer klass)
{
	self->priv = gxml_xhash_map_attr_iterator_get_instance_private (self);
}

static void
gxml_xhash_map_attr_iterator_finalize (GObject * obj)
{
	GXmlXHashMapAttrIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_XHASH_MAP_ATTR_TYPE_ITERATOR, GXmlXHashMapAttrIterator);
	_g_object_unref0 (self->priv->_doc);
	G_OBJECT_CLASS (gxml_xhash_map_attr_iterator_parent_class)->finalize (obj);
}

static GType
gxml_xhash_map_attr_iterator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXHashMapAttrIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xhash_map_attr_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXHashMapAttrIterator), 0, (GInstanceInitFunc) gxml_xhash_map_attr_iterator_instance_init, NULL };
	static const GInterfaceInfo gee_map_iterator_info = { (GInterfaceInitFunc) gxml_xhash_map_attr_iterator_gee_map_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_xhash_map_attr_iterator_type_id;
	gxml_xhash_map_attr_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GXmlXHashMapAttrIterator", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_xhash_map_attr_iterator_type_id, GEE_TYPE_MAP_ITERATOR, &gee_map_iterator_info);
	GXmlXHashMapAttrIterator_private_offset = g_type_add_instance_private (gxml_xhash_map_attr_iterator_type_id, sizeof (GXmlXHashMapAttrIteratorPrivate));
	return gxml_xhash_map_attr_iterator_type_id;
}

GType
gxml_xhash_map_attr_iterator_get_type (void)
{
	static volatile gsize gxml_xhash_map_attr_iterator_type_id__once = 0;
	if (g_once_init_enter (&gxml_xhash_map_attr_iterator_type_id__once)) {
		GType gxml_xhash_map_attr_iterator_type_id;
		gxml_xhash_map_attr_iterator_type_id = gxml_xhash_map_attr_iterator_get_type_once ();
		g_once_init_leave (&gxml_xhash_map_attr_iterator_type_id__once, gxml_xhash_map_attr_iterator_type_id);
	}
	return gxml_xhash_map_attr_iterator_type_id__once;
}

static void
_vala_gxml_xhash_map_attr_iterator_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GXmlXHashMapAttrIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_XHASH_MAP_ATTR_TYPE_ITERATOR, GXmlXHashMapAttrIterator);
	switch (property_id) {
		case GXML_XHASH_MAP_ATTR_ITERATOR_MUTABLE_PROPERTY:
		g_value_set_boolean (value, gee_map_iterator_get_mutable ((GeeMapIterator*) self));
		break;
		case GXML_XHASH_MAP_ATTR_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_map_iterator_get_read_only ((GeeMapIterator*) self));
		break;
		case GXML_XHASH_MAP_ATTR_ITERATOR_VALID_PROPERTY:
		g_value_set_boolean (value, gee_map_iterator_get_valid ((GeeMapIterator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
gxml_xhash_map_attr_class_init (GXmlXHashMapAttrClass * klass,
                                gpointer klass_data)
{
	gxml_xhash_map_attr_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlXHashMapAttr_private_offset);
	((GeeAbstractMapClass *) klass)->clear = (void (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_clear;
	((GeeAbstractMapClass *) klass)->get = (gpointer (*) (GeeAbstractMap*, gconstpointer)) gxml_xhash_map_attr_real_get;
	((GeeAbstractMapClass *) klass)->has = (gboolean (*) (GeeAbstractMap*, gconstpointer, gconstpointer)) gxml_xhash_map_attr_real_has;
	((GeeAbstractMapClass *) klass)->has_key = (gboolean (*) (GeeAbstractMap*, gconstpointer)) gxml_xhash_map_attr_real_has_key;
	((GeeAbstractMapClass *) klass)->map_iterator = (GeeMapIterator* (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_map_iterator;
	((GeeAbstractMapClass *) klass)->set = (void (*) (GeeAbstractMap*, gconstpointer, gconstpointer)) gxml_xhash_map_attr_real_set;
	((GeeAbstractMapClass *) klass)->unset = (gboolean (*) (GeeAbstractMap*, gconstpointer, gpointer*)) gxml_xhash_map_attr_real_unset;
	GEE_ABSTRACT_MAP_CLASS (klass)->get_entries = (GeeSet* (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_get_entries;
	GEE_ABSTRACT_MAP_CLASS (klass)->get_keys = (GeeSet* (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_get_keys;
	GEE_ABSTRACT_MAP_CLASS (klass)->get_read_only = (gboolean (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_get_read_only;
	GEE_ABSTRACT_MAP_CLASS (klass)->get_size = (gint (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_get_size;
	GEE_ABSTRACT_MAP_CLASS (klass)->get_values = (GeeCollection* (*) (GeeAbstractMap*)) gxml_xhash_map_attr_real_get_values;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xhash_map_attr_get_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xhash_map_attr_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_ENTRIES_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_ENTRIES_PROPERTY] = g_param_spec_object ("entries", "entries", "entries", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_KEYS_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_KEYS_PROPERTY] = g_param_spec_object ("keys", "keys", "keys", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_READ_ONLY_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_SIZE_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_VALUES_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_VALUES_PROPERTY] = g_param_spec_object ("values", "values", "values", GEE_TYPE_COLLECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XHASH_MAP_ATTR_LENGTH_PROPERTY, gxml_xhash_map_attr_properties[GXML_XHASH_MAP_ATTR_LENGTH_PROPERTY] = g_param_spec_int ("length", "length", "length", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gxml_xhash_map_attr_gxml_dom_named_node_map_interface_init (GXmlDomNamedNodeMapIface * iface,
                                                            gpointer iface_data)
{
	gxml_xhash_map_attr_gxml_dom_named_node_map_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_named_item = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, const gchar*)) gxml_xhash_map_attr_real_get_named_item;
	iface->item = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, gint)) gxml_xhash_map_attr_real_item;
	iface->set_named_item = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, GXmlDomNode*, GError**)) gxml_xhash_map_attr_real_set_named_item;
	iface->remove_named_item = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, const gchar*, GError**)) gxml_xhash_map_attr_real_remove_named_item;
	iface->get_named_item_ns = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, const gchar*, const gchar*, GError**)) gxml_xhash_map_attr_real_get_named_item_ns;
	iface->set_named_item_ns = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, GXmlDomNode*, GError**)) gxml_xhash_map_attr_real_set_named_item_ns;
	iface->remove_named_item_ns = (GXmlDomNode* (*) (GXmlDomNamedNodeMap*, const gchar*, const gchar*, GError**)) gxml_xhash_map_attr_real_remove_named_item_ns;
	iface->get_length = gxml_xhash_map_attr_real_get_length;
}

static void
gxml_xhash_map_attr_instance_init (GXmlXHashMapAttr * self,
                                   gpointer klass)
{
	self->priv = gxml_xhash_map_attr_get_instance_private (self);
}

static void
gxml_xhash_map_attr_finalize (GObject * obj)
{
	GXmlXHashMapAttr * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_XHASH_MAP_ATTR, GXmlXHashMapAttr);
	_g_object_unref0 (self->priv->_doc);
	G_OBJECT_CLASS (gxml_xhash_map_attr_parent_class)->finalize (obj);
}

/**
 * Implementation of {@link Gee.AbstractMap} to handle {@link Xml.Node} attributes,
 * powered by libxml2 library.
 */
static GType
gxml_xhash_map_attr_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXHashMapAttrClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xhash_map_attr_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXHashMapAttr), 0, (GInstanceInitFunc) gxml_xhash_map_attr_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_named_node_map_info = { (GInterfaceInitFunc) gxml_xhash_map_attr_gxml_dom_named_node_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_xhash_map_attr_type_id;
	gxml_xhash_map_attr_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_MAP, "GXmlXHashMapAttr", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_xhash_map_attr_type_id, GXML_TYPE_DOM_NAMED_NODE_MAP, &gxml_dom_named_node_map_info);
	GXmlXHashMapAttr_private_offset = g_type_add_instance_private (gxml_xhash_map_attr_type_id, sizeof (GXmlXHashMapAttrPrivate));
	return gxml_xhash_map_attr_type_id;
}

GType
gxml_xhash_map_attr_get_type (void)
{
	static volatile gsize gxml_xhash_map_attr_type_id__once = 0;
	if (g_once_init_enter (&gxml_xhash_map_attr_type_id__once)) {
		GType gxml_xhash_map_attr_type_id;
		gxml_xhash_map_attr_type_id = gxml_xhash_map_attr_get_type_once ();
		g_once_init_leave (&gxml_xhash_map_attr_type_id__once, gxml_xhash_map_attr_type_id);
	}
	return gxml_xhash_map_attr_type_id__once;
}

static void
_vala_gxml_xhash_map_attr_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GXmlXHashMapAttr * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XHASH_MAP_ATTR, GXmlXHashMapAttr);
	switch (property_id) {
		case GXML_XHASH_MAP_ATTR_ENTRIES_PROPERTY:
		g_value_take_object (value, gee_abstract_map_get_entries ((GeeAbstractMap*) self));
		break;
		case GXML_XHASH_MAP_ATTR_KEYS_PROPERTY:
		g_value_take_object (value, gee_abstract_map_get_keys ((GeeAbstractMap*) self));
		break;
		case GXML_XHASH_MAP_ATTR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_abstract_map_get_read_only ((GeeAbstractMap*) self));
		break;
		case GXML_XHASH_MAP_ATTR_SIZE_PROPERTY:
		g_value_set_int (value, gee_abstract_map_get_size ((GeeAbstractMap*) self));
		break;
		case GXML_XHASH_MAP_ATTR_VALUES_PROPERTY:
		g_value_take_object (value, gee_abstract_map_get_values ((GeeAbstractMap*) self));
		break;
		case GXML_XHASH_MAP_ATTR_LENGTH_PROPERTY:
		g_value_set_int (value, gxml_dom_named_node_map_get_length ((GXmlDomNamedNodeMap*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

