#include <enunciate-common.c>
#ifndef DEF_agentrank_ns0_agents_H
#define DEF_agentrank_ns0_agents_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_agents {


  /**
   * agent list
   */
  struct agentrank_ns0_agent *agent;

  /**
   * Size of the agent array.
   */
  int _sizeof_agent;
};

/**
 * Reads a Agents element from XML. The element to be read is "agents", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Agents, or NULL in case of error.
 */
struct agentrank_ns0_agents *xml_read_agentrank_ns0_agents(xmlTextReaderPtr reader);

/**
 * Writes a Agents to XML under element name "agents".
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_agents(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents);

/**
 * Frees a Agents.
 *
 * @param _agents The Agents to free.
 */
void free_agentrank_ns0_agents(struct agentrank_ns0_agents *_agents);

/**
 * Reads a Agents element from XML. The element to be read is "agents", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Agents, or NULL in case of error.
 */
struct agentrank_ns0_agents *xmlTextReaderReadNs0AgentsElement(xmlTextReaderPtr reader);

/**
 * Writes a Agents to XML under element name "agents".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentsElement(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents);

/**
 * Writes a Agents to XML under element name "agents".
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents, int writeNamespaces);

/**
 * Frees the children of a Agents.
 *
 * @param _agents The Agents whose children are to be free.
 */
static void freeNs0AgentsElement(struct agentrank_ns0_agents *_agents);

/**
 * Reads a Agents from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Agents, or NULL in case of error.
 */
static struct agentrank_ns0_agents *xmlTextReaderReadNs0AgentsType(xmlTextReaderPtr reader);

/**
 * Writes a Agents to XML.
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentsType(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents);

/**
 * Frees the elements of a Agents.
 *
 * @param _agents The Agents to free.
 */
static void freeNs0AgentsType(struct agentrank_ns0_agents *_agents);

#endif /* DEF_agentrank_ns0_agents_H */
#ifndef DEF_agentrank_ns0_contactAgent_H
#define DEF_agentrank_ns0_contactAgent_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_contactAgent {


  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a ContactAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The ContactAgent, or NULL in case of error.
 */
struct agentrank_ns0_contactAgent *xml_read_agentrank_ns0_contactAgent(xmlTextReaderPtr reader);

/**
 * Writes a ContactAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_contactAgent(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent);

/**
 * Frees a ContactAgent.
 *
 * @param _contactAgent The ContactAgent to free.
 */
void free_agentrank_ns0_contactAgent(struct agentrank_ns0_contactAgent *_contactAgent);

/**
 * Reads a ContactAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The ContactAgent, or NULL in case of error.
 */
struct agentrank_ns0_contactAgent *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a ContactAgent to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent);

/**
 * Writes a ContactAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent, int writeNamespaces);

/**
 * Frees the children of a ContactAgent.
 *
 * @param _contactAgent The ContactAgent whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_contactAgent *_contactAgent);

/**
 * Reads a ContactAgent from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The ContactAgent, or NULL in case of error.
 */
static struct agentrank_ns0_contactAgent *xmlTextReaderReadNs0ContactAgentType(xmlTextReaderPtr reader);

/**
 * Writes a ContactAgent to XML.
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ContactAgentType(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent);

/**
 * Frees the elements of a ContactAgent.
 *
 * @param _contactAgent The ContactAgent to free.
 */
static void freeNs0ContactAgentType(struct agentrank_ns0_contactAgent *_contactAgent);

#endif /* DEF_agentrank_ns0_contactAgent_H */
#ifndef DEF_agentrank_ns0_findAgents_H
#define DEF_agentrank_ns0_findAgents_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_findAgents {


  /**
   * agents
   */
  struct agentrank_ns0_agents *agents;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a FindAgents element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The FindAgents, or NULL in case of error.
 */
struct agentrank_ns0_findAgents *xml_read_agentrank_ns0_findAgents(xmlTextReaderPtr reader);

/**
 * Writes a FindAgents to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_findAgents(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents);

/**
 * Frees a FindAgents.
 *
 * @param _findAgents The FindAgents to free.
 */
void free_agentrank_ns0_findAgents(struct agentrank_ns0_findAgents *_findAgents);

/**
 * Reads a FindAgents element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The FindAgents, or NULL in case of error.
 */
struct agentrank_ns0_findAgents *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a FindAgents to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents);

/**
 * Writes a FindAgents to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents, int writeNamespaces);

/**
 * Frees the children of a FindAgents.
 *
 * @param _findAgents The FindAgents whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_findAgents *_findAgents);

/**
 * Reads a FindAgents from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The FindAgents, or NULL in case of error.
 */
static struct agentrank_ns0_findAgents *xmlTextReaderReadNs0FindAgentsType(xmlTextReaderPtr reader);

/**
 * Writes a FindAgents to XML.
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0FindAgentsType(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents);

/**
 * Frees the elements of a FindAgents.
 *
 * @param _findAgents The FindAgents to free.
 */
static void freeNs0FindAgentsType(struct agentrank_ns0_findAgents *_findAgents);

#endif /* DEF_agentrank_ns0_findAgents_H */
#ifndef DEF_agentrank_ns0_getAgent_H
#define DEF_agentrank_ns0_getAgent_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getAgent {


  /**
   * agent
   */
  struct agentrank_ns0_agent *agent;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetAgent, or NULL in case of error.
 */
struct agentrank_ns0_getAgent *xml_read_agentrank_ns0_getAgent(xmlTextReaderPtr reader);

/**
 * Writes a GetAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getAgent(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent);

/**
 * Frees a GetAgent.
 *
 * @param _getAgent The GetAgent to free.
 */
void free_agentrank_ns0_getAgent(struct agentrank_ns0_getAgent *_getAgent);

/**
 * Reads a GetAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetAgent, or NULL in case of error.
 */
struct agentrank_ns0_getAgent *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetAgent to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent);

/**
 * Writes a GetAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent, int writeNamespaces);

/**
 * Frees the children of a GetAgent.
 *
 * @param _getAgent The GetAgent whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getAgent *_getAgent);

/**
 * Reads a GetAgent from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetAgent, or NULL in case of error.
 */
static struct agentrank_ns0_getAgent *xmlTextReaderReadNs0GetAgentType(xmlTextReaderPtr reader);

/**
 * Writes a GetAgent to XML.
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetAgentType(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent);

/**
 * Frees the elements of a GetAgent.
 *
 * @param _getAgent The GetAgent to free.
 */
static void freeNs0GetAgentType(struct agentrank_ns0_getAgent *_getAgent);

#endif /* DEF_agentrank_ns0_getAgent_H */
#ifndef DEF_agentrank_ns0_getMarket_H
#define DEF_agentrank_ns0_getMarket_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getMarket {


  /**
   * market
   */
  struct agentrank_ns0_market *market;

  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetMarket element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetMarket, or NULL in case of error.
 */
struct agentrank_ns0_getMarket *xml_read_agentrank_ns0_getMarket(xmlTextReaderPtr reader);

/**
 * Writes a GetMarket to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getMarket(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket);

/**
 * Frees a GetMarket.
 *
 * @param _getMarket The GetMarket to free.
 */
void free_agentrank_ns0_getMarket(struct agentrank_ns0_getMarket *_getMarket);

/**
 * Reads a GetMarket element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetMarket, or NULL in case of error.
 */
struct agentrank_ns0_getMarket *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetMarket to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket);

/**
 * Writes a GetMarket to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket, int writeNamespaces);

/**
 * Frees the children of a GetMarket.
 *
 * @param _getMarket The GetMarket whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getMarket *_getMarket);

/**
 * Reads a GetMarket from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetMarket, or NULL in case of error.
 */
static struct agentrank_ns0_getMarket *xmlTextReaderReadNs0GetMarketType(xmlTextReaderPtr reader);

/**
 * Writes a GetMarket to XML.
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetMarketType(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket);

/**
 * Frees the elements of a GetMarket.
 *
 * @param _getMarket The GetMarket to free.
 */
static void freeNs0GetMarketType(struct agentrank_ns0_getMarket *_getMarket);

#endif /* DEF_agentrank_ns0_getMarket_H */
#ifndef DEF_agentrank_ns0_histories_H
#define DEF_agentrank_ns0_histories_H

/**
 *  User: marc Date: Apr 25, 2009 Time: 2:40:22 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_histories {


  /**
   * chart image
   */
  struct agentrank_ns0_image *chart;

  /**
   * history
   */
  struct agentrank_ns0_history *history;

  /**
   * Size of the history array.
   */
  int _sizeof_history;
};

/**
 * Reads a Histories from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Histories, or NULL in case of error.
 */
static struct agentrank_ns0_histories *xmlTextReaderReadNs0HistoriesType(xmlTextReaderPtr reader);

/**
 * Writes a Histories to XML.
 *
 * @param writer The XML writer.
 * @param _histories The Histories to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0HistoriesType(xmlTextWriterPtr writer, struct agentrank_ns0_histories *_histories);

/**
 * Frees the elements of a Histories.
 *
 * @param _histories The Histories to free.
 */
static void freeNs0HistoriesType(struct agentrank_ns0_histories *_histories);

#endif /* DEF_agentrank_ns0_histories_H */
#ifndef DEF_agentrank_ns0_history_H
#define DEF_agentrank_ns0_history_H

/**
 *  User: marc
 Date: Apr 25, 2009
 Time: 2:40:38 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC
 MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_history {


  /**
   * date
   */
  struct tm *date;

  /**
   * (no documentation provided)
   */
  xmlChar *market;

  /**
   * (no documentation provided)
   */
  xmlChar *metric;

  /**
   * (no documentation provided)
   */
  xmlChar *value;
};

/**
 * Reads a History from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The History, or NULL in case of error.
 */
static struct agentrank_ns0_history *xmlTextReaderReadNs0HistoryType(xmlTextReaderPtr reader);

/**
 * Writes a History to XML.
 *
 * @param writer The XML writer.
 * @param _history The History to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0HistoryType(xmlTextWriterPtr writer, struct agentrank_ns0_history *_history);

/**
 * Frees the elements of a History.
 *
 * @param _history The History to free.
 */
static void freeNs0HistoryType(struct agentrank_ns0_history *_history);

#endif /* DEF_agentrank_ns0_history_H */
#ifndef DEF_agentrank_ns0_location_H
#define DEF_agentrank_ns0_location_H

/**
 *  User: marc
 Date: Mar 4, 2008
 Time: 6:39:03 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC
 MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_location {


  /**
   * (no documentation provided)
   */
  int id;

  /**
   * (no documentation provided)
   */
  xmlChar *type;

  /**
   * (no documentation provided)
   */
  xmlChar *name;
};

/**
 * Reads a Location from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Location, or NULL in case of error.
 */
static struct agentrank_ns0_location *xmlTextReaderReadNs0LocationType(xmlTextReaderPtr reader);

/**
 * Writes a Location to XML.
 *
 * @param writer The XML writer.
 * @param _location The Location to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LocationType(xmlTextWriterPtr writer, struct agentrank_ns0_location *_location);

/**
 * Frees the elements of a Location.
 *
 * @param _location The Location to free.
 */
static void freeNs0LocationType(struct agentrank_ns0_location *_location);

#endif /* DEF_agentrank_ns0_location_H */
#ifndef DEF_agentrank_ns0_locations_H
#define DEF_agentrank_ns0_locations_H

/**
 *  User: marc
 Date: Mar 4, 2008
 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC
 MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_locations {


  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_location *location;

  /**
   * Size of the location array.
   */
  int _sizeof_location;
};

/**
 * Reads a Locations element from XML. The element to be read is "locations", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Locations, or NULL in case of error.
 */
struct agentrank_ns0_locations *xml_read_agentrank_ns0_locations(xmlTextReaderPtr reader);

/**
 * Writes a Locations to XML under element name "locations".
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_locations(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations);

/**
 * Frees a Locations.
 *
 * @param _locations The Locations to free.
 */
void free_agentrank_ns0_locations(struct agentrank_ns0_locations *_locations);

/**
 * Reads a Locations element from XML. The element to be read is "locations", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Locations, or NULL in case of error.
 */
struct agentrank_ns0_locations *xmlTextReaderReadNs0LocationsElement(xmlTextReaderPtr reader);

/**
 * Writes a Locations to XML under element name "locations".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LocationsElement(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations);

/**
 * Writes a Locations to XML under element name "locations".
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LocationsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations, int writeNamespaces);

/**
 * Frees the children of a Locations.
 *
 * @param _locations The Locations whose children are to be free.
 */
static void freeNs0LocationsElement(struct agentrank_ns0_locations *_locations);

/**
 * Reads a Locations from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Locations, or NULL in case of error.
 */
static struct agentrank_ns0_locations *xmlTextReaderReadNs0LocationsType(xmlTextReaderPtr reader);

/**
 * Writes a Locations to XML.
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LocationsType(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations);

/**
 * Frees the elements of a Locations.
 *
 * @param _locations The Locations to free.
 */
static void freeNs0LocationsType(struct agentrank_ns0_locations *_locations);

#endif /* DEF_agentrank_ns0_locations_H */
#ifndef DEF_agentrank_ns0_market_H
#define DEF_agentrank_ns0_market_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_market {


  /**
   * market's canonical name
   */
  xmlChar *name;

  /**
   * collection of forecasts
   */
  struct agentrank_ns0_forecasts *forecasts;

  /**
   * history
   */
  struct agentrank_ns0_histories *histories;
};

/**
 * Reads a Market element from XML. The element to be read is "market", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Market, or NULL in case of error.
 */
struct agentrank_ns0_market *xml_read_agentrank_ns0_market(xmlTextReaderPtr reader);

/**
 * Writes a Market to XML under element name "market".
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_market(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market);

/**
 * Frees a Market.
 *
 * @param _market The Market to free.
 */
void free_agentrank_ns0_market(struct agentrank_ns0_market *_market);

/**
 * Reads a Market element from XML. The element to be read is "market", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Market, or NULL in case of error.
 */
struct agentrank_ns0_market *xmlTextReaderReadNs0MarketElement(xmlTextReaderPtr reader);

/**
 * Writes a Market to XML under element name "market".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MarketElement(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market);

/**
 * Writes a Market to XML under element name "market".
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MarketElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market, int writeNamespaces);

/**
 * Frees the children of a Market.
 *
 * @param _market The Market whose children are to be free.
 */
static void freeNs0MarketElement(struct agentrank_ns0_market *_market);

/**
 * Reads a Market from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Market, or NULL in case of error.
 */
static struct agentrank_ns0_market *xmlTextReaderReadNs0MarketType(xmlTextReaderPtr reader);

/**
 * Writes a Market to XML.
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MarketType(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market);

/**
 * Frees the elements of a Market.
 *
 * @param _market The Market to free.
 */
static void freeNs0MarketType(struct agentrank_ns0_market *_market);

#endif /* DEF_agentrank_ns0_market_H */
#ifndef DEF_agentrank_ns0_photoSize_H
#define DEF_agentrank_ns0_photoSize_H

/**
 *  User: marc
 Date: Mar 4, 2008
 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC
 MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_photoSize {


  /**
   * (no documentation provided)
   */
  int height;

  /**
   * (no documentation provided)
   */
  int width;

  /**
   * (no documentation provided)
   */
  xmlChar *type;
};

/**
 * Reads a PhotoSize element from XML. The element to be read is "photoSize", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PhotoSize, or NULL in case of error.
 */
struct agentrank_ns0_photoSize *xml_read_agentrank_ns0_photoSize(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_photoSize(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize);

/**
 * Frees a PhotoSize.
 *
 * @param _photoSize The PhotoSize to free.
 */
void free_agentrank_ns0_photoSize(struct agentrank_ns0_photoSize *_photoSize);

/**
 * Reads a PhotoSize element from XML. The element to be read is "photoSize", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The PhotoSize, or NULL in case of error.
 */
struct agentrank_ns0_photoSize *xmlTextReaderReadNs0PhotoSizeElement(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizeElement(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize);

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizeElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize, int writeNamespaces);

/**
 * Frees the children of a PhotoSize.
 *
 * @param _photoSize The PhotoSize whose children are to be free.
 */
static void freeNs0PhotoSizeElement(struct agentrank_ns0_photoSize *_photoSize);

/**
 * Reads a PhotoSize from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The PhotoSize, or NULL in case of error.
 */
static struct agentrank_ns0_photoSize *xmlTextReaderReadNs0PhotoSizeType(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSize to XML.
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizeType(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize);

/**
 * Frees the elements of a PhotoSize.
 *
 * @param _photoSize The PhotoSize to free.
 */
static void freeNs0PhotoSizeType(struct agentrank_ns0_photoSize *_photoSize);

#endif /* DEF_agentrank_ns0_photoSize_H */
#ifndef DEF_agentrank_ns0_photoSizes_H
#define DEF_agentrank_ns0_photoSizes_H

/**
 *  User: marc
 Date: Mar 4, 2008
 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC
 MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_photoSizes {


  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_photoSize *size;

  /**
   * Size of the size array.
   */
  int _sizeof_size;
};

/**
 * Reads a PhotoSizes element from XML. The element to be read is "photoSizes", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PhotoSizes, or NULL in case of error.
 */
struct agentrank_ns0_photoSizes *xml_read_agentrank_ns0_photoSizes(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_photoSizes(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes);

/**
 * Frees a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes to free.
 */
void free_agentrank_ns0_photoSizes(struct agentrank_ns0_photoSizes *_photoSizes);

/**
 * Reads a PhotoSizes element from XML. The element to be read is "photoSizes", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The PhotoSizes, or NULL in case of error.
 */
struct agentrank_ns0_photoSizes *xmlTextReaderReadNs0PhotoSizesElement(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizesElement(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes);

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes, int writeNamespaces);

/**
 * Frees the children of a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes whose children are to be free.
 */
static void freeNs0PhotoSizesElement(struct agentrank_ns0_photoSizes *_photoSizes);

/**
 * Reads a PhotoSizes from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The PhotoSizes, or NULL in case of error.
 */
static struct agentrank_ns0_photoSizes *xmlTextReaderReadNs0PhotoSizesType(xmlTextReaderPtr reader);

/**
 * Writes a PhotoSizes to XML.
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PhotoSizesType(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes);

/**
 * Frees the elements of a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes to free.
 */
static void freeNs0PhotoSizesType(struct agentrank_ns0_photoSizes *_photoSizes);

#endif /* DEF_agentrank_ns0_photoSizes_H */
#ifndef DEF_agentrank_ns0_pagedList_H
#define DEF_agentrank_ns0_pagedList_H

/**
 * (no documentation provided)
 */
struct agentrank_ns0_pagedList {


  /**
   * (no documentation provided)
   */
  int *start_index;

  /**
   * (no documentation provided)
   */
  int *max_results;

  /**
   * (no documentation provided)
   */
  int *last_index;

  /**
   * (no documentation provided)
   */
  int *total_results;

  /**
   * (no documentation provided)
   */
  int *first_index;
};

/**
 * Reads a PagedList from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The PagedList, or NULL in case of error.
 */
static struct agentrank_ns0_pagedList *xmlTextReaderReadNs0PagedListType(xmlTextReaderPtr reader);

/**
 * Writes a PagedList to XML.
 *
 * @param writer The XML writer.
 * @param _pagedList The PagedList to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PagedListType(xmlTextWriterPtr writer, struct agentrank_ns0_pagedList *_pagedList);

/**
 * Frees the elements of a PagedList.
 *
 * @param _pagedList The PagedList to free.
 */
static void freeNs0PagedListType(struct agentrank_ns0_pagedList *_pagedList);

#endif /* DEF_agentrank_ns0_pagedList_H */
#ifndef DEF_agentrank_ns0_agent_H
#define DEF_agentrank_ns0_agent_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_agent {


  /**
   * (no documentation provided)
   */
  xmlChar *id;

  /**
   * sales
   */
  struct agentrank_ns0_sales *sales;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_images *charts;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_profile *profile;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_reviews *reviews;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_forecasts *forecasts;
};

/**
 * Reads a Agent element from XML. The element to be read is "agent", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Agent, or NULL in case of error.
 */
struct agentrank_ns0_agent *xml_read_agentrank_ns0_agent(xmlTextReaderPtr reader);

/**
 * Writes a Agent to XML under element name "agent".
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_agent(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent);

/**
 * Frees a Agent.
 *
 * @param _agent The Agent to free.
 */
void free_agentrank_ns0_agent(struct agentrank_ns0_agent *_agent);

/**
 * Reads a Agent element from XML. The element to be read is "agent", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Agent, or NULL in case of error.
 */
struct agentrank_ns0_agent *xmlTextReaderReadNs0AgentElement(xmlTextReaderPtr reader);

/**
 * Writes a Agent to XML under element name "agent".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentElement(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent);

/**
 * Writes a Agent to XML under element name "agent".
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent, int writeNamespaces);

/**
 * Frees the children of a Agent.
 *
 * @param _agent The Agent whose children are to be free.
 */
static void freeNs0AgentElement(struct agentrank_ns0_agent *_agent);

/**
 * Reads a Agent from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Agent, or NULL in case of error.
 */
static struct agentrank_ns0_agent *xmlTextReaderReadNs0AgentType(xmlTextReaderPtr reader);

/**
 * Writes a Agent to XML.
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0AgentType(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent);

/**
 * Frees the elements of a Agent.
 *
 * @param _agent The Agent to free.
 */
static void freeNs0AgentType(struct agentrank_ns0_agent *_agent);

#endif /* DEF_agentrank_ns0_agent_H */
#ifndef DEF_agentrank_ns0_claimProfile_H
#define DEF_agentrank_ns0_claimProfile_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Jul 24, 2010 Time: 7:07:31 AM

 */
struct agentrank_ns0_claimProfile {


  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a ClaimProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The ClaimProfile, or NULL in case of error.
 */
struct agentrank_ns0_claimProfile *xml_read_agentrank_ns0_claimProfile(xmlTextReaderPtr reader);

/**
 * Writes a ClaimProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_claimProfile(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile);

/**
 * Frees a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile to free.
 */
void free_agentrank_ns0_claimProfile(struct agentrank_ns0_claimProfile *_claimProfile);

/**
 * Reads a ClaimProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The ClaimProfile, or NULL in case of error.
 */
struct agentrank_ns0_claimProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a ClaimProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile);

/**
 * Writes a ClaimProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile, int writeNamespaces);

/**
 * Frees the children of a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_claimProfile *_claimProfile);

/**
 * Reads a ClaimProfile from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The ClaimProfile, or NULL in case of error.
 */
static struct agentrank_ns0_claimProfile *xmlTextReaderReadNs0ClaimProfileType(xmlTextReaderPtr reader);

/**
 * Writes a ClaimProfile to XML.
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ClaimProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile);

/**
 * Frees the elements of a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile to free.
 */
static void freeNs0ClaimProfileType(struct agentrank_ns0_claimProfile *_claimProfile);

#endif /* DEF_agentrank_ns0_claimProfile_H */
#ifndef DEF_agentrank_ns0_findProfiles_H
#define DEF_agentrank_ns0_findProfiles_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_findProfiles {


  /**
   * status
   */
  struct agentrank_ns0_status *status;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_profiles *profiles;
};

/**
 * Reads a FindProfiles element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The FindProfiles, or NULL in case of error.
 */
struct agentrank_ns0_findProfiles *xml_read_agentrank_ns0_findProfiles(xmlTextReaderPtr reader);

/**
 * Writes a FindProfiles to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_findProfiles(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles);

/**
 * Frees a FindProfiles.
 *
 * @param _findProfiles The FindProfiles to free.
 */
void free_agentrank_ns0_findProfiles(struct agentrank_ns0_findProfiles *_findProfiles);

/**
 * Reads a FindProfiles element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The FindProfiles, or NULL in case of error.
 */
struct agentrank_ns0_findProfiles *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a FindProfiles to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles);

/**
 * Writes a FindProfiles to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles, int writeNamespaces);

/**
 * Frees the children of a FindProfiles.
 *
 * @param _findProfiles The FindProfiles whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_findProfiles *_findProfiles);

/**
 * Reads a FindProfiles from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The FindProfiles, or NULL in case of error.
 */
static struct agentrank_ns0_findProfiles *xmlTextReaderReadNs0FindProfilesType(xmlTextReaderPtr reader);

/**
 * Writes a FindProfiles to XML.
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0FindProfilesType(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles);

/**
 * Frees the elements of a FindProfiles.
 *
 * @param _findProfiles The FindProfiles to free.
 */
static void freeNs0FindProfilesType(struct agentrank_ns0_findProfiles *_findProfiles);

#endif /* DEF_agentrank_ns0_findProfiles_H */
#ifndef DEF_agentrank_ns0_forecast_H
#define DEF_agentrank_ns0_forecast_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_forecast {


  /**
   * (no documentation provided)
   */
  int *id;

  /**
   * (no documentation provided)
   */
  xmlChar *key;

  /**
   * attribution link
   */
  struct agentrank_ns0_link *link;

  /**
   * future date
   */
  struct tm *date;

  /**
   * slugs
   */
  struct agentrank_ns0_slugs *slugs;

  /**
   * body
   */
  xmlChar *body;

  /**
   * title
   */
  xmlChar *title;

  /**
   * market name
   */
  xmlChar *market;

  /**
   * (no documentation provided)
   */
  xmlChar *metric;

  /**
   * (no documentation provided)
   */
  xmlChar *spot;

  /**
   * (no documentation provided)
   */
  xmlChar *future;
};

/**
 * Reads a Forecast element from XML. The element to be read is "forecast", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Forecast, or NULL in case of error.
 */
struct agentrank_ns0_forecast *xml_read_agentrank_ns0_forecast(xmlTextReaderPtr reader);

/**
 * Writes a Forecast to XML under element name "forecast".
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_forecast(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast);

/**
 * Frees a Forecast.
 *
 * @param _forecast The Forecast to free.
 */
void free_agentrank_ns0_forecast(struct agentrank_ns0_forecast *_forecast);

/**
 * Reads a Forecast element from XML. The element to be read is "forecast", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Forecast, or NULL in case of error.
 */
struct agentrank_ns0_forecast *xmlTextReaderReadNs0ForecastElement(xmlTextReaderPtr reader);

/**
 * Writes a Forecast to XML under element name "forecast".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastElement(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast);

/**
 * Writes a Forecast to XML under element name "forecast".
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast, int writeNamespaces);

/**
 * Frees the children of a Forecast.
 *
 * @param _forecast The Forecast whose children are to be free.
 */
static void freeNs0ForecastElement(struct agentrank_ns0_forecast *_forecast);

/**
 * Reads a Forecast from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Forecast, or NULL in case of error.
 */
static struct agentrank_ns0_forecast *xmlTextReaderReadNs0ForecastType(xmlTextReaderPtr reader);

/**
 * Writes a Forecast to XML.
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastType(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast);

/**
 * Frees the elements of a Forecast.
 *
 * @param _forecast The Forecast to free.
 */
static void freeNs0ForecastType(struct agentrank_ns0_forecast *_forecast);

#endif /* DEF_agentrank_ns0_forecast_H */
#ifndef DEF_agentrank_ns0_forecasts_H
#define DEF_agentrank_ns0_forecasts_H

/**
 *  A root element for a collection of forecasts.  The underlying data source can be either the forecasts of an individual agent or the aggregate forecasts of multiple agents.
 <p/>
 User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_forecasts {


  /**
   * (no documentation provided)
   */
  int *start_index;

  /**
   * (no documentation provided)
   */
  int *max_results;

  /**
   * (no documentation provided)
   */
  int *last_index;

  /**
   * (no documentation provided)
   */
  int *total_results;

  /**
   * (no documentation provided)
   */
  int *first_index;

  /**
   * title
   */
  xmlChar *title;

  /**
   * list
   */
  struct agentrank_ns0_forecast *forecast;

  /**
   * Size of the forecast array.
   */
  int _sizeof_forecast;
};

/**
 * Reads a Forecasts element from XML. The element to be read is "forecasts", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Forecasts, or NULL in case of error.
 */
struct agentrank_ns0_forecasts *xml_read_agentrank_ns0_forecasts(xmlTextReaderPtr reader);

/**
 * Writes a Forecasts to XML under element name "forecasts".
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_forecasts(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts);

/**
 * Frees a Forecasts.
 *
 * @param _forecasts The Forecasts to free.
 */
void free_agentrank_ns0_forecasts(struct agentrank_ns0_forecasts *_forecasts);

/**
 * Reads a Forecasts element from XML. The element to be read is "forecasts", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Forecasts, or NULL in case of error.
 */
struct agentrank_ns0_forecasts *xmlTextReaderReadNs0ForecastsElement(xmlTextReaderPtr reader);

/**
 * Writes a Forecasts to XML under element name "forecasts".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastsElement(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts);

/**
 * Writes a Forecasts to XML under element name "forecasts".
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts, int writeNamespaces);

/**
 * Frees the children of a Forecasts.
 *
 * @param _forecasts The Forecasts whose children are to be free.
 */
static void freeNs0ForecastsElement(struct agentrank_ns0_forecasts *_forecasts);

/**
 * Reads a Forecasts from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Forecasts, or NULL in case of error.
 */
static struct agentrank_ns0_forecasts *xmlTextReaderReadNs0ForecastsType(xmlTextReaderPtr reader);

/**
 * Writes a Forecasts to XML.
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ForecastsType(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts);

/**
 * Frees the elements of a Forecasts.
 *
 * @param _forecasts The Forecasts to free.
 */
static void freeNs0ForecastsType(struct agentrank_ns0_forecasts *_forecasts);

#endif /* DEF_agentrank_ns0_forecasts_H */
#ifndef DEF_agentrank_ns0_getForecast_H
#define DEF_agentrank_ns0_getForecast_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Dec 8, 2010 Time: 10:30:36 AM

 */
struct agentrank_ns0_getForecast {


  /**
   * the image chart
   */
  struct agentrank_ns0_images *charts;

  /**
   * forecast
   */
  struct agentrank_ns0_forecast *forecast;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetForecast element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetForecast, or NULL in case of error.
 */
struct agentrank_ns0_getForecast *xml_read_agentrank_ns0_getForecast(xmlTextReaderPtr reader);

/**
 * Writes a GetForecast to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getForecast(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast);

/**
 * Frees a GetForecast.
 *
 * @param _getForecast The GetForecast to free.
 */
void free_agentrank_ns0_getForecast(struct agentrank_ns0_getForecast *_getForecast);

/**
 * Reads a GetForecast element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetForecast, or NULL in case of error.
 */
struct agentrank_ns0_getForecast *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetForecast to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast);

/**
 * Writes a GetForecast to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast, int writeNamespaces);

/**
 * Frees the children of a GetForecast.
 *
 * @param _getForecast The GetForecast whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getForecast *_getForecast);

/**
 * Reads a GetForecast from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetForecast, or NULL in case of error.
 */
static struct agentrank_ns0_getForecast *xmlTextReaderReadNs0GetForecastType(xmlTextReaderPtr reader);

/**
 * Writes a GetForecast to XML.
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetForecastType(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast);

/**
 * Frees the elements of a GetForecast.
 *
 * @param _getForecast The GetForecast to free.
 */
static void freeNs0GetForecastType(struct agentrank_ns0_getForecast *_getForecast);

#endif /* DEF_agentrank_ns0_getForecast_H */
#ifndef DEF_agentrank_ns0_getForecasts_H
#define DEF_agentrank_ns0_getForecasts_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getForecasts {


  /**
   * chart image
   */
  struct agentrank_ns0_images *charts;

  /**
   * status
   */
  struct agentrank_ns0_status *status;

  /**
   * forecasting
   */
  struct agentrank_ns0_forecasts *forecasts;
};

/**
 * Reads a GetForecasts element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetForecasts, or NULL in case of error.
 */
struct agentrank_ns0_getForecasts *xml_read_agentrank_ns0_getForecasts(xmlTextReaderPtr reader);

/**
 * Writes a GetForecasts to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getForecasts(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts);

/**
 * Frees a GetForecasts.
 *
 * @param _getForecasts The GetForecasts to free.
 */
void free_agentrank_ns0_getForecasts(struct agentrank_ns0_getForecasts *_getForecasts);

/**
 * Reads a GetForecasts element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetForecasts, or NULL in case of error.
 */
struct agentrank_ns0_getForecasts *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetForecasts to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts);

/**
 * Writes a GetForecasts to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts, int writeNamespaces);

/**
 * Frees the children of a GetForecasts.
 *
 * @param _getForecasts The GetForecasts whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getForecasts *_getForecasts);

/**
 * Reads a GetForecasts from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetForecasts, or NULL in case of error.
 */
static struct agentrank_ns0_getForecasts *xmlTextReaderReadNs0GetForecastsType(xmlTextReaderPtr reader);

/**
 * Writes a GetForecasts to XML.
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetForecastsType(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts);

/**
 * Frees the elements of a GetForecasts.
 *
 * @param _getForecasts The GetForecasts to free.
 */
static void freeNs0GetForecastsType(struct agentrank_ns0_getForecasts *_getForecasts);

#endif /* DEF_agentrank_ns0_getForecasts_H */
#ifndef DEF_agentrank_ns0_getProfile_H
#define DEF_agentrank_ns0_getProfile_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getProfile {


  /**
   * status
   */
  struct agentrank_ns0_status *status;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_profile *profile;
};

/**
 * Reads a GetProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetProfile, or NULL in case of error.
 */
struct agentrank_ns0_getProfile *xml_read_agentrank_ns0_getProfile(xmlTextReaderPtr reader);

/**
 * Writes a GetProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getProfile(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile);

/**
 * Frees a GetProfile.
 *
 * @param _getProfile The GetProfile to free.
 */
void free_agentrank_ns0_getProfile(struct agentrank_ns0_getProfile *_getProfile);

/**
 * Reads a GetProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetProfile, or NULL in case of error.
 */
struct agentrank_ns0_getProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile);

/**
 * Writes a GetProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile, int writeNamespaces);

/**
 * Frees the children of a GetProfile.
 *
 * @param _getProfile The GetProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getProfile *_getProfile);

/**
 * Reads a GetProfile from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetProfile, or NULL in case of error.
 */
static struct agentrank_ns0_getProfile *xmlTextReaderReadNs0GetProfileType(xmlTextReaderPtr reader);

/**
 * Writes a GetProfile to XML.
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile);

/**
 * Frees the elements of a GetProfile.
 *
 * @param _getProfile The GetProfile to free.
 */
static void freeNs0GetProfileType(struct agentrank_ns0_getProfile *_getProfile);

#endif /* DEF_agentrank_ns0_getProfile_H */
#ifndef DEF_agentrank_ns0_getReview_H
#define DEF_agentrank_ns0_getReview_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getReview {


  /**
   * status
   */
  struct agentrank_ns0_status *status;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_review *review;
};

/**
 * Reads a GetReview element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetReview, or NULL in case of error.
 */
struct agentrank_ns0_getReview *xml_read_agentrank_ns0_getReview(xmlTextReaderPtr reader);

/**
 * Writes a GetReview to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getReview(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview);

/**
 * Frees a GetReview.
 *
 * @param _getReview The GetReview to free.
 */
void free_agentrank_ns0_getReview(struct agentrank_ns0_getReview *_getReview);

/**
 * Reads a GetReview element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetReview, or NULL in case of error.
 */
struct agentrank_ns0_getReview *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetReview to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview);

/**
 * Writes a GetReview to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview, int writeNamespaces);

/**
 * Frees the children of a GetReview.
 *
 * @param _getReview The GetReview whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getReview *_getReview);

/**
 * Reads a GetReview from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetReview, or NULL in case of error.
 */
static struct agentrank_ns0_getReview *xmlTextReaderReadNs0GetReviewType(xmlTextReaderPtr reader);

/**
 * Writes a GetReview to XML.
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetReviewType(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview);

/**
 * Frees the elements of a GetReview.
 *
 * @param _getReview The GetReview to free.
 */
static void freeNs0GetReviewType(struct agentrank_ns0_getReview *_getReview);

#endif /* DEF_agentrank_ns0_getReview_H */
#ifndef DEF_agentrank_ns0_getReviews_H
#define DEF_agentrank_ns0_getReviews_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getReviews {


  /**
   * status
   */
  struct agentrank_ns0_status *status;

  /**
   * chart links
   */
  struct agentrank_ns0_images *charts;

  /**
   * reviews
   */
  struct agentrank_ns0_reviews *reviews;
};

/**
 * Reads a GetReviews element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetReviews, or NULL in case of error.
 */
struct agentrank_ns0_getReviews *xml_read_agentrank_ns0_getReviews(xmlTextReaderPtr reader);

/**
 * Writes a GetReviews to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getReviews(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews);

/**
 * Frees a GetReviews.
 *
 * @param _getReviews The GetReviews to free.
 */
void free_agentrank_ns0_getReviews(struct agentrank_ns0_getReviews *_getReviews);

/**
 * Reads a GetReviews element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetReviews, or NULL in case of error.
 */
struct agentrank_ns0_getReviews *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetReviews to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews);

/**
 * Writes a GetReviews to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews, int writeNamespaces);

/**
 * Frees the children of a GetReviews.
 *
 * @param _getReviews The GetReviews whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getReviews *_getReviews);

/**
 * Reads a GetReviews from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetReviews, or NULL in case of error.
 */
static struct agentrank_ns0_getReviews *xmlTextReaderReadNs0GetReviewsType(xmlTextReaderPtr reader);

/**
 * Writes a GetReviews to XML.
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetReviewsType(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews);

/**
 * Frees the elements of a GetReviews.
 *
 * @param _getReviews The GetReviews to free.
 */
static void freeNs0GetReviewsType(struct agentrank_ns0_getReviews *_getReviews);

#endif /* DEF_agentrank_ns0_getReviews_H */
#ifndef DEF_agentrank_ns0_getSale_H
#define DEF_agentrank_ns0_getSale_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getSale {


  /**
   * sale
   */
  struct agentrank_ns0_sale *sale;

  /**
   * maps
   */
  struct agentrank_ns0_images *maps;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetSale element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetSale, or NULL in case of error.
 */
struct agentrank_ns0_getSale *xml_read_agentrank_ns0_getSale(xmlTextReaderPtr reader);

/**
 * Writes a GetSale to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getSale(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale);

/**
 * Frees a GetSale.
 *
 * @param _getSale The GetSale to free.
 */
void free_agentrank_ns0_getSale(struct agentrank_ns0_getSale *_getSale);

/**
 * Reads a GetSale element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetSale, or NULL in case of error.
 */
struct agentrank_ns0_getSale *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetSale to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale);

/**
 * Writes a GetSale to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale, int writeNamespaces);

/**
 * Frees the children of a GetSale.
 *
 * @param _getSale The GetSale whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getSale *_getSale);

/**
 * Reads a GetSale from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetSale, or NULL in case of error.
 */
static struct agentrank_ns0_getSale *xmlTextReaderReadNs0GetSaleType(xmlTextReaderPtr reader);

/**
 * Writes a GetSale to XML.
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetSaleType(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale);

/**
 * Frees the elements of a GetSale.
 *
 * @param _getSale The GetSale to free.
 */
static void freeNs0GetSaleType(struct agentrank_ns0_getSale *_getSale);

#endif /* DEF_agentrank_ns0_getSale_H */
#ifndef DEF_agentrank_ns0_getSales_H
#define DEF_agentrank_ns0_getSales_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_getSales {


  /**
   * sales
   */
  struct agentrank_ns0_sales *sales;

  /**
   * static map
   */
  struct agentrank_ns0_images *maps;

  /**
   * chart links
   */
  struct agentrank_ns0_images *charts;

  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetSales element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetSales, or NULL in case of error.
 */
struct agentrank_ns0_getSales *xml_read_agentrank_ns0_getSales(xmlTextReaderPtr reader);

/**
 * Writes a GetSales to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getSales(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales);

/**
 * Frees a GetSales.
 *
 * @param _getSales The GetSales to free.
 */
void free_agentrank_ns0_getSales(struct agentrank_ns0_getSales *_getSales);

/**
 * Reads a GetSales element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetSales, or NULL in case of error.
 */
struct agentrank_ns0_getSales *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetSales to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales);

/**
 * Writes a GetSales to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales, int writeNamespaces);

/**
 * Frees the children of a GetSales.
 *
 * @param _getSales The GetSales whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getSales *_getSales);

/**
 * Reads a GetSales from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetSales, or NULL in case of error.
 */
static struct agentrank_ns0_getSales *xmlTextReaderReadNs0GetSalesType(xmlTextReaderPtr reader);

/**
 * Writes a GetSales to XML.
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetSalesType(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales);

/**
 * Frees the elements of a GetSales.
 *
 * @param _getSales The GetSales to free.
 */
static void freeNs0GetSalesType(struct agentrank_ns0_getSales *_getSales);

#endif /* DEF_agentrank_ns0_getSales_H */
#ifndef DEF_agentrank_ns0_pokeProfile_H
#define DEF_agentrank_ns0_pokeProfile_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Jul 24, 2010 Time: 7:07:31 AM

 */
struct agentrank_ns0_pokeProfile {


  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a PokeProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PokeProfile, or NULL in case of error.
 */
struct agentrank_ns0_pokeProfile *xml_read_agentrank_ns0_pokeProfile(xmlTextReaderPtr reader);

/**
 * Writes a PokeProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_pokeProfile(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile);

/**
 * Frees a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile to free.
 */
void free_agentrank_ns0_pokeProfile(struct agentrank_ns0_pokeProfile *_pokeProfile);

/**
 * Reads a PokeProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The PokeProfile, or NULL in case of error.
 */
struct agentrank_ns0_pokeProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a PokeProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile);

/**
 * Writes a PokeProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile, int writeNamespaces);

/**
 * Frees the children of a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_pokeProfile *_pokeProfile);

/**
 * Reads a PokeProfile from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The PokeProfile, or NULL in case of error.
 */
static struct agentrank_ns0_pokeProfile *xmlTextReaderReadNs0PokeProfileType(xmlTextReaderPtr reader);

/**
 * Writes a PokeProfile to XML.
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PokeProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile);

/**
 * Frees the elements of a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile to free.
 */
static void freeNs0PokeProfileType(struct agentrank_ns0_pokeProfile *_pokeProfile);

#endif /* DEF_agentrank_ns0_pokeProfile_H */
#ifndef DEF_agentrank_ns0_postFlag_H
#define DEF_agentrank_ns0_postFlag_H

/**
 *  User: marc Date: Oct 1, 2009 Time: 5:26:25 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_postFlag {


  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a PostFlag element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PostFlag, or NULL in case of error.
 */
struct agentrank_ns0_postFlag *xml_read_agentrank_ns0_postFlag(xmlTextReaderPtr reader);

/**
 * Writes a PostFlag to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_postFlag(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag);

/**
 * Frees a PostFlag.
 *
 * @param _postFlag The PostFlag to free.
 */
void free_agentrank_ns0_postFlag(struct agentrank_ns0_postFlag *_postFlag);

/**
 * Reads a PostFlag element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The PostFlag, or NULL in case of error.
 */
struct agentrank_ns0_postFlag *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a PostFlag to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag);

/**
 * Writes a PostFlag to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag, int writeNamespaces);

/**
 * Frees the children of a PostFlag.
 *
 * @param _postFlag The PostFlag whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_postFlag *_postFlag);

/**
 * Reads a PostFlag from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The PostFlag, or NULL in case of error.
 */
static struct agentrank_ns0_postFlag *xmlTextReaderReadNs0PostFlagType(xmlTextReaderPtr reader);

/**
 * Writes a PostFlag to XML.
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0PostFlagType(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag);

/**
 * Frees the elements of a PostFlag.
 *
 * @param _postFlag The PostFlag to free.
 */
static void freeNs0PostFlagType(struct agentrank_ns0_postFlag *_postFlag);

#endif /* DEF_agentrank_ns0_postFlag_H */
#ifndef DEF_agentrank_ns0_profile_H
#define DEF_agentrank_ns0_profile_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN
 CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_profile {


  /**
   * (no documentation provided)
   */
  int *id;

  /**
   * (no documentation provided)
   */
  xmlChar *username;

  /**
   * (no documentation provided)
   */
  int activated;

  /**
   * link
   */
  struct agentrank_ns0_link *link;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_image *photo;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_slugs *slugs;

  /**
   * (no documentation provided)
   */
  xmlChar *title;

  /**
   * (no documentation provided)
   */
  xmlChar *full_name;

  /**
   * (no documentation provided)
   */
  xmlChar *description;

  /**
   * (no documentation provided)
   */
  int *rank;

  /**
   * (no documentation provided)
   */
  int *sales;

  /**
   * (no documentation provided)
   */
  int *reviews;

  /**
   * (no documentation provided)
   */
  int *forecasts;

  /**
   * (no documentation provided)
   */
  xmlChar *experience;
};

/**
 * Reads a Profile element from XML. The element to be read is "profile", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Profile, or NULL in case of error.
 */
struct agentrank_ns0_profile *xml_read_agentrank_ns0_profile(xmlTextReaderPtr reader);

/**
 * Writes a Profile to XML under element name "profile".
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_profile(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile);

/**
 * Frees a Profile.
 *
 * @param _profile The Profile to free.
 */
void free_agentrank_ns0_profile(struct agentrank_ns0_profile *_profile);

/**
 * Reads a Profile element from XML. The element to be read is "profile", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Profile, or NULL in case of error.
 */
struct agentrank_ns0_profile *xmlTextReaderReadNs0ProfileElement(xmlTextReaderPtr reader);

/**
 * Writes a Profile to XML under element name "profile".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfileElement(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile);

/**
 * Writes a Profile to XML under element name "profile".
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfileElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile, int writeNamespaces);

/**
 * Frees the children of a Profile.
 *
 * @param _profile The Profile whose children are to be free.
 */
static void freeNs0ProfileElement(struct agentrank_ns0_profile *_profile);

/**
 * Reads a Profile from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Profile, or NULL in case of error.
 */
static struct agentrank_ns0_profile *xmlTextReaderReadNs0ProfileType(xmlTextReaderPtr reader);

/**
 * Writes a Profile to XML.
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile);

/**
 * Frees the elements of a Profile.
 *
 * @param _profile The Profile to free.
 */
static void freeNs0ProfileType(struct agentrank_ns0_profile *_profile);

#endif /* DEF_agentrank_ns0_profile_H */
#ifndef DEF_agentrank_ns0_profiles_H
#define DEF_agentrank_ns0_profiles_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_profiles {


  /**
   * (no documentation provided)
   */
  int *start_index;

  /**
   * (no documentation provided)
   */
  int *max_results;

  /**
   * (no documentation provided)
   */
  int *last_index;

  /**
   * (no documentation provided)
   */
  int *total_results;

  /**
   * (no documentation provided)
   */
  int *first_index;

  /**
   * location
   */
  xmlChar *location;

  /**
   * (no documentation provided)
   */
  enum agentrank_ns0_locationContext *context;

  /**
   * list of profiles
   */
  struct agentrank_ns0_profile *profile;

  /**
   * Size of the profile array.
   */
  int _sizeof_profile;
};

/**
 * Reads a Profiles element from XML. The element to be read is "profiles", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Profiles, or NULL in case of error.
 */
struct agentrank_ns0_profiles *xml_read_agentrank_ns0_profiles(xmlTextReaderPtr reader);

/**
 * Writes a Profiles to XML under element name "profiles".
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_profiles(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles);

/**
 * Frees a Profiles.
 *
 * @param _profiles The Profiles to free.
 */
void free_agentrank_ns0_profiles(struct agentrank_ns0_profiles *_profiles);

/**
 * Reads a Profiles element from XML. The element to be read is "profiles", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Profiles, or NULL in case of error.
 */
struct agentrank_ns0_profiles *xmlTextReaderReadNs0ProfilesElement(xmlTextReaderPtr reader);

/**
 * Writes a Profiles to XML under element name "profiles".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfilesElement(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles);

/**
 * Writes a Profiles to XML under element name "profiles".
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfilesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles, int writeNamespaces);

/**
 * Frees the children of a Profiles.
 *
 * @param _profiles The Profiles whose children are to be free.
 */
static void freeNs0ProfilesElement(struct agentrank_ns0_profiles *_profiles);

/**
 * Reads a Profiles from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Profiles, or NULL in case of error.
 */
static struct agentrank_ns0_profiles *xmlTextReaderReadNs0ProfilesType(xmlTextReaderPtr reader);

/**
 * Writes a Profiles to XML.
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ProfilesType(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles);

/**
 * Frees the elements of a Profiles.
 *
 * @param _profiles The Profiles to free.
 */
static void freeNs0ProfilesType(struct agentrank_ns0_profiles *_profiles);

#endif /* DEF_agentrank_ns0_profiles_H */
#ifndef DEF_agentrank_ns0_sale_H
#define DEF_agentrank_ns0_sale_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN
 CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_sale {


  /**
   * (no documentation provided)
   */
  int *id;

  /**
   * (no documentation provided)
   */
  xmlChar *longitude;

  /**
   * (no documentation provided)
   */
  xmlChar *latitude;

  /**
   * (no documentation provided)
   */
  xmlChar *key;

  /**
   * link
   */
  struct agentrank_ns0_link *link;

  /**
   * (no documentation provided)
   */
  struct tm *list_date;

  /**
   * (no documentation provided)
   */
  struct tm *sold_date;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_slugs *slugs;

  /**
   * (no documentation provided)
   */
  xmlChar *zip;

  /**
   * (no documentation provided)
   */
  xmlChar *city;

  /**
   * (no documentation provided)
   */
  xmlChar *state;

  /**
   * (no documentation provided)
   */
  xmlChar *title;

  /**
   * (no documentation provided)
   */
  xmlChar *address;

  /**
   * (no documentation provided)
   */
  xmlChar *precision;

  /**
   * (no documentation provided)
   */
  xmlChar *property_type;

  /**
   * (no documentation provided)
   */
  xmlChar *transaction_side;

  /**
   * (no documentation provided)
   */
  int *market_days;

  /**
   * (no documentation provided)
   */
  xmlChar *list_price_final;

  /**
   * (no documentation provided)
   */
  xmlChar *sale_price_final;

  /**
   * (no documentation provided)
   */
  xmlChar *list_price_original;

  /**
   * (no documentation provided)
   */
  xmlChar *price_per_size_unit;
};

/**
 * Reads a Sale element from XML. The element to be read is "sale", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Sale, or NULL in case of error.
 */
struct agentrank_ns0_sale *xml_read_agentrank_ns0_sale(xmlTextReaderPtr reader);

/**
 * Writes a Sale to XML under element name "sale".
 *
 * @param writer The XML writer.
 * @param _sale The Sale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_sale(xmlTextWriterPtr writer, struct agentrank_ns0_sale *_sale);

/**
 * Frees a Sale.
 *
 * @param _sale The Sale to free.
 */
void free_agentrank_ns0_sale(struct agentrank_ns0_sale *_sale);

/**
 * Reads a Sale element from XML. The element to be read is "sale", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Sale, or NULL in case of error.
 */
struct agentrank_ns0_sale *xmlTextReaderReadNs0SaleElement(xmlTextReaderPtr reader);

/**
 * Writes a Sale to XML under element name "sale".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _sale The Sale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SaleElement(xmlTextWriterPtr writer, struct agentrank_ns0_sale *_sale);

/**
 * Writes a Sale to XML under element name "sale".
 *
 * @param writer The XML writer.
 * @param _sale The Sale to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SaleElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_sale *_sale, int writeNamespaces);

/**
 * Frees the children of a Sale.
 *
 * @param _sale The Sale whose children are to be free.
 */
static void freeNs0SaleElement(struct agentrank_ns0_sale *_sale);

/**
 * Reads a Sale from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Sale, or NULL in case of error.
 */
static struct agentrank_ns0_sale *xmlTextReaderReadNs0SaleType(xmlTextReaderPtr reader);

/**
 * Writes a Sale to XML.
 *
 * @param writer The XML writer.
 * @param _sale The Sale to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SaleType(xmlTextWriterPtr writer, struct agentrank_ns0_sale *_sale);

/**
 * Frees the elements of a Sale.
 *
 * @param _sale The Sale to free.
 */
static void freeNs0SaleType(struct agentrank_ns0_sale *_sale);

#endif /* DEF_agentrank_ns0_sale_H */
#ifndef DEF_agentrank_ns0_sales_H
#define DEF_agentrank_ns0_sales_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN
 CONSENT OF SOCO TECHNOLOGIES.

 */
struct agentrank_ns0_sales {


  /**
   * (no documentation provided)
   */
  int *start_index;

  /**
   * (no documentation provided)
   */
  int *max_results;

  /**
   * (no documentation provided)
   */
  int *last_index;

  /**
   * (no documentation provided)
   */
  int *total_results;

  /**
   * (no documentation provided)
   */
  int *first_index;

  /**
   * longitude
   */
  xmlChar *longitude;

  /**
   * latitude
   */
  xmlChar *latitude;

  /**
   * list of sales
   */
  struct agentrank_ns0_sale *sale;

  /**
   * Size of the sale array.
   */
  int _sizeof_sale;
};

/**
 * Reads a Sales element from XML. The element to be read is "sales", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Sales, or NULL in case of error.
 */
struct agentrank_ns0_sales *xml_read_agentrank_ns0_sales(xmlTextReaderPtr reader);

/**
 * Writes a Sales to XML under element name "sales".
 *
 * @param writer The XML writer.
 * @param _sales The Sales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_sales(xmlTextWriterPtr writer, struct agentrank_ns0_sales *_sales);

/**
 * Frees a Sales.
 *
 * @param _sales The Sales to free.
 */
void free_agentrank_ns0_sales(struct agentrank_ns0_sales *_sales);

/**
 * Reads a Sales element from XML. The element to be read is "sales", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Sales, or NULL in case of error.
 */
struct agentrank_ns0_sales *xmlTextReaderReadNs0SalesElement(xmlTextReaderPtr reader);

/**
 * Writes a Sales to XML under element name "sales".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _sales The Sales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SalesElement(xmlTextWriterPtr writer, struct agentrank_ns0_sales *_sales);

/**
 * Writes a Sales to XML under element name "sales".
 *
 * @param writer The XML writer.
 * @param _sales The Sales to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SalesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_sales *_sales, int writeNamespaces);

/**
 * Frees the children of a Sales.
 *
 * @param _sales The Sales whose children are to be free.
 */
static void freeNs0SalesElement(struct agentrank_ns0_sales *_sales);

/**
 * Reads a Sales from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Sales, or NULL in case of error.
 */
static struct agentrank_ns0_sales *xmlTextReaderReadNs0SalesType(xmlTextReaderPtr reader);

/**
 * Writes a Sales to XML.
 *
 * @param writer The XML writer.
 * @param _sales The Sales to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SalesType(xmlTextWriterPtr writer, struct agentrank_ns0_sales *_sales);

/**
 * Frees the elements of a Sales.
 *
 * @param _sales The Sales to free.
 */
static void freeNs0SalesType(struct agentrank_ns0_sales *_sales);

#endif /* DEF_agentrank_ns0_sales_H */
#ifndef DEF_agentrank_ns0_content_H
#define DEF_agentrank_ns0_content_H

/**
 *  User: marc Date: May 12, 2009 Time: 8:28:24 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_content {


  /**
   * (no documentation provided)
   */
  xmlChar *type;

  /**
   * (no documentation provided)
   */
  xmlChar *value;
};

/**
 * Reads a Content element from XML. The element to be read is "content", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Content, or NULL in case of error.
 */
struct agentrank_ns0_content *xml_read_agentrank_ns0_content(xmlTextReaderPtr reader);

/**
 * Writes a Content to XML under element name "content".
 *
 * @param writer The XML writer.
 * @param _content The Content to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_content(xmlTextWriterPtr writer, struct agentrank_ns0_content *_content);

/**
 * Frees a Content.
 *
 * @param _content The Content to free.
 */
void free_agentrank_ns0_content(struct agentrank_ns0_content *_content);

/**
 * Reads a Content element from XML. The element to be read is "content", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Content, or NULL in case of error.
 */
struct agentrank_ns0_content *xmlTextReaderReadNs0ContentElement(xmlTextReaderPtr reader);

/**
 * Writes a Content to XML under element name "content".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _content The Content to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ContentElement(xmlTextWriterPtr writer, struct agentrank_ns0_content *_content);

/**
 * Writes a Content to XML under element name "content".
 *
 * @param writer The XML writer.
 * @param _content The Content to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ContentElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_content *_content, int writeNamespaces);

/**
 * Frees the children of a Content.
 *
 * @param _content The Content whose children are to be free.
 */
static void freeNs0ContentElement(struct agentrank_ns0_content *_content);

/**
 * Reads a Content from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Content, or NULL in case of error.
 */
static struct agentrank_ns0_content *xmlTextReaderReadNs0ContentType(xmlTextReaderPtr reader);

/**
 * Writes a Content to XML.
 *
 * @param writer The XML writer.
 * @param _content The Content to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ContentType(xmlTextWriterPtr writer, struct agentrank_ns0_content *_content);

/**
 * Frees the elements of a Content.
 *
 * @param _content The Content to free.
 */
static void freeNs0ContentType(struct agentrank_ns0_content *_content);

#endif /* DEF_agentrank_ns0_content_H */
#ifndef DEF_agentrank_ns0_image_H
#define DEF_agentrank_ns0_image_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_image {


  /**
   * (no documentation provided)
   */
  int *height;

  /**
   * (no documentation provided)
   */
  xmlChar *alt;

  /**
   * (no documentation provided)
   */
  int *width;

  /**
   * (no documentation provided)
   */
  xmlChar *url;
};

/**
 * Reads a Image element from XML. The element to be read is "image", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Image, or NULL in case of error.
 */
struct agentrank_ns0_image *xml_read_agentrank_ns0_image(xmlTextReaderPtr reader);

/**
 * Writes a Image to XML under element name "image".
 *
 * @param writer The XML writer.
 * @param _image The Image to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_image(xmlTextWriterPtr writer, struct agentrank_ns0_image *_image);

/**
 * Frees a Image.
 *
 * @param _image The Image to free.
 */
void free_agentrank_ns0_image(struct agentrank_ns0_image *_image);

/**
 * Reads a Image element from XML. The element to be read is "image", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Image, or NULL in case of error.
 */
struct agentrank_ns0_image *xmlTextReaderReadNs0ImageElement(xmlTextReaderPtr reader);

/**
 * Writes a Image to XML under element name "image".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _image The Image to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImageElement(xmlTextWriterPtr writer, struct agentrank_ns0_image *_image);

/**
 * Writes a Image to XML under element name "image".
 *
 * @param writer The XML writer.
 * @param _image The Image to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImageElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_image *_image, int writeNamespaces);

/**
 * Frees the children of a Image.
 *
 * @param _image The Image whose children are to be free.
 */
static void freeNs0ImageElement(struct agentrank_ns0_image *_image);

/**
 * Reads a Image from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Image, or NULL in case of error.
 */
static struct agentrank_ns0_image *xmlTextReaderReadNs0ImageType(xmlTextReaderPtr reader);

/**
 * Writes a Image to XML.
 *
 * @param writer The XML writer.
 * @param _image The Image to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImageType(xmlTextWriterPtr writer, struct agentrank_ns0_image *_image);

/**
 * Frees the elements of a Image.
 *
 * @param _image The Image to free.
 */
static void freeNs0ImageType(struct agentrank_ns0_image *_image);

#endif /* DEF_agentrank_ns0_image_H */
#ifndef DEF_agentrank_ns0_images_H
#define DEF_agentrank_ns0_images_H

/**
 *  User: marc Date: May 13, 2009 Time: 5:44:51 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_images {


  /**
   * get list of links
   */
  struct agentrank_ns0_image *image;

  /**
   * Size of the image array.
   */
  int _sizeof_image;
};

/**
 * Reads a Images element from XML. The element to be read is "images", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Images, or NULL in case of error.
 */
struct agentrank_ns0_images *xml_read_agentrank_ns0_images(xmlTextReaderPtr reader);

/**
 * Writes a Images to XML under element name "images".
 *
 * @param writer The XML writer.
 * @param _images The Images to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_images(xmlTextWriterPtr writer, struct agentrank_ns0_images *_images);

/**
 * Frees a Images.
 *
 * @param _images The Images to free.
 */
void free_agentrank_ns0_images(struct agentrank_ns0_images *_images);

/**
 * Reads a Images element from XML. The element to be read is "images", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Images, or NULL in case of error.
 */
struct agentrank_ns0_images *xmlTextReaderReadNs0ImagesElement(xmlTextReaderPtr reader);

/**
 * Writes a Images to XML under element name "images".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _images The Images to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImagesElement(xmlTextWriterPtr writer, struct agentrank_ns0_images *_images);

/**
 * Writes a Images to XML under element name "images".
 *
 * @param writer The XML writer.
 * @param _images The Images to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImagesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_images *_images, int writeNamespaces);

/**
 * Frees the children of a Images.
 *
 * @param _images The Images whose children are to be free.
 */
static void freeNs0ImagesElement(struct agentrank_ns0_images *_images);

/**
 * Reads a Images from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Images, or NULL in case of error.
 */
static struct agentrank_ns0_images *xmlTextReaderReadNs0ImagesType(xmlTextReaderPtr reader);

/**
 * Writes a Images to XML.
 *
 * @param writer The XML writer.
 * @param _images The Images to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ImagesType(xmlTextWriterPtr writer, struct agentrank_ns0_images *_images);

/**
 * Frees the elements of a Images.
 *
 * @param _images The Images to free.
 */
static void freeNs0ImagesType(struct agentrank_ns0_images *_images);

#endif /* DEF_agentrank_ns0_images_H */
#ifndef DEF_agentrank_ns0_link_H
#define DEF_agentrank_ns0_link_H

/**
 *  User: marc Date: Mar 24, 2008 Time: 6:44:23 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_link {


  /**
   * (no documentation provided)
   */
  xmlChar *id;

  /**
   * (no documentation provided)
   */
  xmlChar *title;

  /**
   * (no documentation provided)
   */
  xmlChar *text;

  /**
   * (no documentation provided)
   */
  xmlChar *mouseover;

  /**
   * (no documentation provided)
   */
  xmlChar *rel;

  /**
   * (no documentation provided)
   */
  xmlChar *type;

  /**
   * (no documentation provided)
   */
  xmlChar *href;
};

/**
 * Reads a Link element from XML. The element to be read is "link", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Link, or NULL in case of error.
 */
struct agentrank_ns0_link *xml_read_agentrank_ns0_link(xmlTextReaderPtr reader);

/**
 * Writes a Link to XML under element name "link".
 *
 * @param writer The XML writer.
 * @param _link The Link to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_link(xmlTextWriterPtr writer, struct agentrank_ns0_link *_link);

/**
 * Frees a Link.
 *
 * @param _link The Link to free.
 */
void free_agentrank_ns0_link(struct agentrank_ns0_link *_link);

/**
 * Reads a Link element from XML. The element to be read is "link", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Link, or NULL in case of error.
 */
struct agentrank_ns0_link *xmlTextReaderReadNs0LinkElement(xmlTextReaderPtr reader);

/**
 * Writes a Link to XML under element name "link".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _link The Link to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinkElement(xmlTextWriterPtr writer, struct agentrank_ns0_link *_link);

/**
 * Writes a Link to XML under element name "link".
 *
 * @param writer The XML writer.
 * @param _link The Link to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinkElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_link *_link, int writeNamespaces);

/**
 * Frees the children of a Link.
 *
 * @param _link The Link whose children are to be free.
 */
static void freeNs0LinkElement(struct agentrank_ns0_link *_link);

/**
 * Reads a Link from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Link, or NULL in case of error.
 */
static struct agentrank_ns0_link *xmlTextReaderReadNs0LinkType(xmlTextReaderPtr reader);

/**
 * Writes a Link to XML.
 *
 * @param writer The XML writer.
 * @param _link The Link to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinkType(xmlTextWriterPtr writer, struct agentrank_ns0_link *_link);

/**
 * Frees the elements of a Link.
 *
 * @param _link The Link to free.
 */
static void freeNs0LinkType(struct agentrank_ns0_link *_link);

#endif /* DEF_agentrank_ns0_link_H */
#ifndef DEF_agentrank_ns0_links_H
#define DEF_agentrank_ns0_links_H

/**
 *  User: marc Date: May 13, 2009 Time: 5:44:51 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_links {


  /**
   * get list of links
   */
  struct agentrank_ns0_link *link;

  /**
   * Size of the link array.
   */
  int _sizeof_link;
};

/**
 * Reads a Links element from XML. The element to be read is "links", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Links, or NULL in case of error.
 */
struct agentrank_ns0_links *xml_read_agentrank_ns0_links(xmlTextReaderPtr reader);

/**
 * Writes a Links to XML under element name "links".
 *
 * @param writer The XML writer.
 * @param _links The Links to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_links(xmlTextWriterPtr writer, struct agentrank_ns0_links *_links);

/**
 * Frees a Links.
 *
 * @param _links The Links to free.
 */
void free_agentrank_ns0_links(struct agentrank_ns0_links *_links);

/**
 * Reads a Links element from XML. The element to be read is "links", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Links, or NULL in case of error.
 */
struct agentrank_ns0_links *xmlTextReaderReadNs0LinksElement(xmlTextReaderPtr reader);

/**
 * Writes a Links to XML under element name "links".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _links The Links to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinksElement(xmlTextWriterPtr writer, struct agentrank_ns0_links *_links);

/**
 * Writes a Links to XML under element name "links".
 *
 * @param writer The XML writer.
 * @param _links The Links to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinksElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_links *_links, int writeNamespaces);

/**
 * Frees the children of a Links.
 *
 * @param _links The Links whose children are to be free.
 */
static void freeNs0LinksElement(struct agentrank_ns0_links *_links);

/**
 * Reads a Links from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Links, or NULL in case of error.
 */
static struct agentrank_ns0_links *xmlTextReaderReadNs0LinksType(xmlTextReaderPtr reader);

/**
 * Writes a Links to XML.
 *
 * @param writer The XML writer.
 * @param _links The Links to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LinksType(xmlTextWriterPtr writer, struct agentrank_ns0_links *_links);

/**
 * Frees the elements of a Links.
 *
 * @param _links The Links to free.
 */
static void freeNs0LinksType(struct agentrank_ns0_links *_links);

#endif /* DEF_agentrank_ns0_links_H */
#ifndef DEF_agentrank_ns0_messages_H
#define DEF_agentrank_ns0_messages_H

/**
 *  User: marc Date: Jul 17, 2009 Time: 3:05:10 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_messages {


  /**
   * list of messages
   */
  xmlChar *message;

  /**
   * Size of the message array.
   */
  int _sizeof_message;
};

/**
 * Reads a Messages element from XML. The element to be read is "messages", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Messages, or NULL in case of error.
 */
struct agentrank_ns0_messages *xml_read_agentrank_ns0_messages(xmlTextReaderPtr reader);

/**
 * Writes a Messages to XML under element name "messages".
 *
 * @param writer The XML writer.
 * @param _messages The Messages to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_messages(xmlTextWriterPtr writer, struct agentrank_ns0_messages *_messages);

/**
 * Frees a Messages.
 *
 * @param _messages The Messages to free.
 */
void free_agentrank_ns0_messages(struct agentrank_ns0_messages *_messages);

/**
 * Reads a Messages element from XML. The element to be read is "messages", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Messages, or NULL in case of error.
 */
struct agentrank_ns0_messages *xmlTextReaderReadNs0MessagesElement(xmlTextReaderPtr reader);

/**
 * Writes a Messages to XML under element name "messages".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _messages The Messages to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MessagesElement(xmlTextWriterPtr writer, struct agentrank_ns0_messages *_messages);

/**
 * Writes a Messages to XML under element name "messages".
 *
 * @param writer The XML writer.
 * @param _messages The Messages to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MessagesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_messages *_messages, int writeNamespaces);

/**
 * Frees the children of a Messages.
 *
 * @param _messages The Messages whose children are to be free.
 */
static void freeNs0MessagesElement(struct agentrank_ns0_messages *_messages);

/**
 * Reads a Messages from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Messages, or NULL in case of error.
 */
static struct agentrank_ns0_messages *xmlTextReaderReadNs0MessagesType(xmlTextReaderPtr reader);

/**
 * Writes a Messages to XML.
 *
 * @param writer The XML writer.
 * @param _messages The Messages to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0MessagesType(xmlTextWriterPtr writer, struct agentrank_ns0_messages *_messages);

/**
 * Frees the elements of a Messages.
 *
 * @param _messages The Messages to free.
 */
static void freeNs0MessagesType(struct agentrank_ns0_messages *_messages);

#endif /* DEF_agentrank_ns0_messages_H */
#ifndef DEF_agentrank_ns0_slug_H
#define DEF_agentrank_ns0_slug_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Nov 17, 2010 Time: 3:29:07 PM

 */
struct agentrank_ns0_slug {


  /**
   * (no documentation provided)
   */
  enum agentrank_ns0_slugType *type;

  /**
   * (no documentation provided)
   */
  xmlChar *value;
};

/**
 * Reads a Slug element from XML. The element to be read is "slug", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Slug, or NULL in case of error.
 */
struct agentrank_ns0_slug *xml_read_agentrank_ns0_slug(xmlTextReaderPtr reader);

/**
 * Writes a Slug to XML under element name "slug".
 *
 * @param writer The XML writer.
 * @param _slug The Slug to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_slug(xmlTextWriterPtr writer, struct agentrank_ns0_slug *_slug);

/**
 * Frees a Slug.
 *
 * @param _slug The Slug to free.
 */
void free_agentrank_ns0_slug(struct agentrank_ns0_slug *_slug);

/**
 * Reads a Slug element from XML. The element to be read is "slug", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Slug, or NULL in case of error.
 */
struct agentrank_ns0_slug *xmlTextReaderReadNs0SlugElement(xmlTextReaderPtr reader);

/**
 * Writes a Slug to XML under element name "slug".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _slug The Slug to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugElement(xmlTextWriterPtr writer, struct agentrank_ns0_slug *_slug);

/**
 * Writes a Slug to XML under element name "slug".
 *
 * @param writer The XML writer.
 * @param _slug The Slug to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_slug *_slug, int writeNamespaces);

/**
 * Frees the children of a Slug.
 *
 * @param _slug The Slug whose children are to be free.
 */
static void freeNs0SlugElement(struct agentrank_ns0_slug *_slug);

/**
 * Reads a Slug from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Slug, or NULL in case of error.
 */
static struct agentrank_ns0_slug *xmlTextReaderReadNs0SlugType(xmlTextReaderPtr reader);

/**
 * Writes a Slug to XML.
 *
 * @param writer The XML writer.
 * @param _slug The Slug to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugType(xmlTextWriterPtr writer, struct agentrank_ns0_slug *_slug);

/**
 * Frees the elements of a Slug.
 *
 * @param _slug The Slug to free.
 */
static void freeNs0SlugType(struct agentrank_ns0_slug *_slug);

#endif /* DEF_agentrank_ns0_slug_H */
#ifndef DEF_agentrank_ns0_slugType_H
#define DEF_agentrank_ns0_slugType_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Nov 17, 2010 Time: 3:45:20 PM

 */
enum agentrank_ns0_slugType {

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_SLUGTYPE_HYPHEN,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_SLUGTYPE_UNDERSCORE
};

/**
 * Reads a SlugType from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The SlugType, or NULL if unable to be read.
 */
static enum agentrank_ns0_slugType *xmlTextReaderReadNs0SlugTypeType(xmlTextReaderPtr reader);

/**
 * Writes a SlugType to XML.
 *
 * @param writer The XML writer.
 * @param _slugType The SlugType to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugTypeType(xmlTextWriterPtr writer, enum agentrank_ns0_slugType *_slugType);

/**
 * Frees a SlugType.
 *
 * @param _slugType The SlugType to free.
 */
static void freeNs0SlugTypeType(enum agentrank_ns0_slugType *_slugType);

#endif
#ifndef DEF_agentrank_ns0_slugs_H
#define DEF_agentrank_ns0_slugs_H

/**
 *  User: marc Date: May 13, 2009 Time: 5:44:51 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_slugs {


  /**
   * get list of slugs
   */
  struct agentrank_ns0_slug *slug;

  /**
   * Size of the slug array.
   */
  int _sizeof_slug;
};

/**
 * Reads a Slugs element from XML. The element to be read is "slugs", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Slugs, or NULL in case of error.
 */
struct agentrank_ns0_slugs *xml_read_agentrank_ns0_slugs(xmlTextReaderPtr reader);

/**
 * Writes a Slugs to XML under element name "slugs".
 *
 * @param writer The XML writer.
 * @param _slugs The Slugs to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_slugs(xmlTextWriterPtr writer, struct agentrank_ns0_slugs *_slugs);

/**
 * Frees a Slugs.
 *
 * @param _slugs The Slugs to free.
 */
void free_agentrank_ns0_slugs(struct agentrank_ns0_slugs *_slugs);

/**
 * Reads a Slugs element from XML. The element to be read is "slugs", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Slugs, or NULL in case of error.
 */
struct agentrank_ns0_slugs *xmlTextReaderReadNs0SlugsElement(xmlTextReaderPtr reader);

/**
 * Writes a Slugs to XML under element name "slugs".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _slugs The Slugs to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugsElement(xmlTextWriterPtr writer, struct agentrank_ns0_slugs *_slugs);

/**
 * Writes a Slugs to XML under element name "slugs".
 *
 * @param writer The XML writer.
 * @param _slugs The Slugs to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_slugs *_slugs, int writeNamespaces);

/**
 * Frees the children of a Slugs.
 *
 * @param _slugs The Slugs whose children are to be free.
 */
static void freeNs0SlugsElement(struct agentrank_ns0_slugs *_slugs);

/**
 * Reads a Slugs from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Slugs, or NULL in case of error.
 */
static struct agentrank_ns0_slugs *xmlTextReaderReadNs0SlugsType(xmlTextReaderPtr reader);

/**
 * Writes a Slugs to XML.
 *
 * @param writer The XML writer.
 * @param _slugs The Slugs to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0SlugsType(xmlTextWriterPtr writer, struct agentrank_ns0_slugs *_slugs);

/**
 * Frees the elements of a Slugs.
 *
 * @param _slugs The Slugs to free.
 */
static void freeNs0SlugsType(struct agentrank_ns0_slugs *_slugs);

#endif /* DEF_agentrank_ns0_slugs_H */
#ifndef DEF_agentrank_ns0_status_H
#define DEF_agentrank_ns0_status_H

/**
 *  User: marc Date: May 13, 2009 Time: 5:37:18 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_status {


  /**
   * (no documentation provided)
   */
  int code;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_messages *messages;
};

/**
 * Reads a Status element from XML. The element to be read is "status", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Status, or NULL in case of error.
 */
struct agentrank_ns0_status *xml_read_agentrank_ns0_status(xmlTextReaderPtr reader);

/**
 * Writes a Status to XML under element name "status".
 *
 * @param writer The XML writer.
 * @param _status The Status to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_status(xmlTextWriterPtr writer, struct agentrank_ns0_status *_status);

/**
 * Frees a Status.
 *
 * @param _status The Status to free.
 */
void free_agentrank_ns0_status(struct agentrank_ns0_status *_status);

/**
 * Reads a Status element from XML. The element to be read is "status", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Status, or NULL in case of error.
 */
struct agentrank_ns0_status *xmlTextReaderReadNs0StatusElement(xmlTextReaderPtr reader);

/**
 * Writes a Status to XML under element name "status".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _status The Status to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0StatusElement(xmlTextWriterPtr writer, struct agentrank_ns0_status *_status);

/**
 * Writes a Status to XML under element name "status".
 *
 * @param writer The XML writer.
 * @param _status The Status to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0StatusElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_status *_status, int writeNamespaces);

/**
 * Frees the children of a Status.
 *
 * @param _status The Status whose children are to be free.
 */
static void freeNs0StatusElement(struct agentrank_ns0_status *_status);

/**
 * Reads a Status from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Status, or NULL in case of error.
 */
static struct agentrank_ns0_status *xmlTextReaderReadNs0StatusType(xmlTextReaderPtr reader);

/**
 * Writes a Status to XML.
 *
 * @param writer The XML writer.
 * @param _status The Status to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0StatusType(xmlTextWriterPtr writer, struct agentrank_ns0_status *_status);

/**
 * Frees the elements of a Status.
 *
 * @param _status The Status to free.
 */
static void freeNs0StatusType(struct agentrank_ns0_status *_status);

#endif /* DEF_agentrank_ns0_status_H */
#ifndef DEF_agentrank_ns0_timestamp_H
#define DEF_agentrank_ns0_timestamp_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Aug 25, 2010 Time: 9:46:16 AM

 */
struct agentrank_ns0_timestamp {


  /**
   * (no documentation provided)
   */
  long time;

  /**
   * (no documentation provided)
   */
  xmlChar *value;
};

/**
 * Reads a Timestamp element from XML. The element to be read is "timestamp", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Timestamp, or NULL in case of error.
 */
struct agentrank_ns0_timestamp *xml_read_agentrank_ns0_timestamp(xmlTextReaderPtr reader);

/**
 * Writes a Timestamp to XML under element name "timestamp".
 *
 * @param writer The XML writer.
 * @param _timestamp The Timestamp to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_timestamp(xmlTextWriterPtr writer, struct agentrank_ns0_timestamp *_timestamp);

/**
 * Frees a Timestamp.
 *
 * @param _timestamp The Timestamp to free.
 */
void free_agentrank_ns0_timestamp(struct agentrank_ns0_timestamp *_timestamp);

/**
 * Reads a Timestamp element from XML. The element to be read is "timestamp", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Timestamp, or NULL in case of error.
 */
struct agentrank_ns0_timestamp *xmlTextReaderReadNs0TimestampElement(xmlTextReaderPtr reader);

/**
 * Writes a Timestamp to XML under element name "timestamp".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _timestamp The Timestamp to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0TimestampElement(xmlTextWriterPtr writer, struct agentrank_ns0_timestamp *_timestamp);

/**
 * Writes a Timestamp to XML under element name "timestamp".
 *
 * @param writer The XML writer.
 * @param _timestamp The Timestamp to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0TimestampElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_timestamp *_timestamp, int writeNamespaces);

/**
 * Frees the children of a Timestamp.
 *
 * @param _timestamp The Timestamp whose children are to be free.
 */
static void freeNs0TimestampElement(struct agentrank_ns0_timestamp *_timestamp);

/**
 * Reads a Timestamp from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Timestamp, or NULL in case of error.
 */
static struct agentrank_ns0_timestamp *xmlTextReaderReadNs0TimestampType(xmlTextReaderPtr reader);

/**
 * Writes a Timestamp to XML.
 *
 * @param writer The XML writer.
 * @param _timestamp The Timestamp to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0TimestampType(xmlTextWriterPtr writer, struct agentrank_ns0_timestamp *_timestamp);

/**
 * Frees the elements of a Timestamp.
 *
 * @param _timestamp The Timestamp to free.
 */
static void freeNs0TimestampType(struct agentrank_ns0_timestamp *_timestamp);

#endif /* DEF_agentrank_ns0_timestamp_H */
#ifndef DEF_agentrank_ns0_locationContext_H
#define DEF_agentrank_ns0_locationContext_H

/**
 * (no documentation provided)
 */
enum agentrank_ns0_locationContext {

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_CITY,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_STATE,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_METRO,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_ADDRESS,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_LISTING,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_ZIPCODE,

  /**
   * (no documentation provided)
   */
  AGENTRANK_NS0_LOCATIONCONTEXT_NEIGHBORHOOD
};

/**
 * Reads a LocationContext from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The LocationContext, or NULL if unable to be read.
 */
static enum agentrank_ns0_locationContext *xmlTextReaderReadNs0LocationContextType(xmlTextReaderPtr reader);

/**
 * Writes a LocationContext to XML.
 *
 * @param writer The XML writer.
 * @param _locationContext The LocationContext to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0LocationContextType(xmlTextWriterPtr writer, enum agentrank_ns0_locationContext *_locationContext);

/**
 * Frees a LocationContext.
 *
 * @param _locationContext The LocationContext to free.
 */
static void freeNs0LocationContextType(enum agentrank_ns0_locationContext *_locationContext);

#endif
#ifndef DEF_agentrank_ns0_editUser_H
#define DEF_agentrank_ns0_editUser_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Jul 24, 2010 Time: 7:07:31 AM

 */
struct agentrank_ns0_editUser {


  /**
   * id
   */
  xmlChar *id;

  /**
   * (no documentation provided)
   */
  xmlChar *login;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_links *links;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a EditUser element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The EditUser, or NULL in case of error.
 */
struct agentrank_ns0_editUser *xml_read_agentrank_ns0_editUser(xmlTextReaderPtr reader);

/**
 * Writes a EditUser to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _editUser The EditUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_editUser(xmlTextWriterPtr writer, struct agentrank_ns0_editUser *_editUser);

/**
 * Frees a EditUser.
 *
 * @param _editUser The EditUser to free.
 */
void free_agentrank_ns0_editUser(struct agentrank_ns0_editUser *_editUser);

/**
 * Reads a EditUser element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The EditUser, or NULL in case of error.
 */
struct agentrank_ns0_editUser *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a EditUser to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _editUser The EditUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_editUser *_editUser);

/**
 * Writes a EditUser to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _editUser The EditUser to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_editUser *_editUser, int writeNamespaces);

/**
 * Frees the children of a EditUser.
 *
 * @param _editUser The EditUser whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_editUser *_editUser);

/**
 * Reads a EditUser from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The EditUser, or NULL in case of error.
 */
static struct agentrank_ns0_editUser *xmlTextReaderReadNs0EditUserType(xmlTextReaderPtr reader);

/**
 * Writes a EditUser to XML.
 *
 * @param writer The XML writer.
 * @param _editUser The EditUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0EditUserType(xmlTextWriterPtr writer, struct agentrank_ns0_editUser *_editUser);

/**
 * Frees the elements of a EditUser.
 *
 * @param _editUser The EditUser to free.
 */
static void freeNs0EditUserType(struct agentrank_ns0_editUser *_editUser);

#endif /* DEF_agentrank_ns0_editUser_H */
#ifndef DEF_agentrank_ns0_getUser_H
#define DEF_agentrank_ns0_getUser_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Jul 24, 2010 Time: 7:07:31 AM

 */
struct agentrank_ns0_getUser {


  /**
   * user
   */
  struct agentrank_ns0_user *user;

  /**
   * status
   */
  struct agentrank_ns0_status *status;
};

/**
 * Reads a GetUser element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetUser, or NULL in case of error.
 */
struct agentrank_ns0_getUser *xml_read_agentrank_ns0_getUser(xmlTextReaderPtr reader);

/**
 * Writes a GetUser to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getUser The GetUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_getUser(xmlTextWriterPtr writer, struct agentrank_ns0_getUser *_getUser);

/**
 * Frees a GetUser.
 *
 * @param _getUser The GetUser to free.
 */
void free_agentrank_ns0_getUser(struct agentrank_ns0_getUser *_getUser);

/**
 * Reads a GetUser element from XML. The element to be read is "response", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The GetUser, or NULL in case of error.
 */
struct agentrank_ns0_getUser *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader);

/**
 * Writes a GetUser to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getUser The GetUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getUser *_getUser);

/**
 * Writes a GetUser to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getUser The GetUser to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getUser *_getUser, int writeNamespaces);

/**
 * Frees the children of a GetUser.
 *
 * @param _getUser The GetUser whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getUser *_getUser);

/**
 * Reads a GetUser from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The GetUser, or NULL in case of error.
 */
static struct agentrank_ns0_getUser *xmlTextReaderReadNs0GetUserType(xmlTextReaderPtr reader);

/**
 * Writes a GetUser to XML.
 *
 * @param writer The XML writer.
 * @param _getUser The GetUser to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0GetUserType(xmlTextWriterPtr writer, struct agentrank_ns0_getUser *_getUser);

/**
 * Frees the elements of a GetUser.
 *
 * @param _getUser The GetUser to free.
 */
static void freeNs0GetUserType(struct agentrank_ns0_getUser *_getUser);

#endif /* DEF_agentrank_ns0_getUser_H */
#ifndef DEF_agentrank_ns0_review_H
#define DEF_agentrank_ns0_review_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:39:03 PM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_review {


  /**
   * (no documentation provided)
   */
  int *id;

  /**
   * (no documentation provided)
   */
  xmlChar *key;

  /**
   * link
   */
  struct agentrank_ns0_link *link;

  /**
   * (no documentation provided)
   */
  struct tm *date;

  /**
   * (no documentation provided)
   */
  struct agentrank_ns0_slugs *slugs;

  /**
   * (no documentation provided)
   */
  xmlChar *name;

  /**
   * (no documentation provided)
   */
  xmlChar *email;

  /**
   * (no documentation provided)
   */
  xmlChar *title;

  /**
   * (no documentation provided)
   */
  xmlChar *comment;

  /**
   * (no documentation provided)
   */
  xmlChar *satisfied;

  /**
   * (no documentation provided)
   */
  xmlChar *recommend;
};

/**
 * Reads a Review from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Review, or NULL in case of error.
 */
static struct agentrank_ns0_review *xmlTextReaderReadNs0ReviewType(xmlTextReaderPtr reader);

/**
 * Writes a Review to XML.
 *
 * @param writer The XML writer.
 * @param _review The Review to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ReviewType(xmlTextWriterPtr writer, struct agentrank_ns0_review *_review);

/**
 * Frees the elements of a Review.
 *
 * @param _review The Review to free.
 */
static void freeNs0ReviewType(struct agentrank_ns0_review *_review);

#endif /* DEF_agentrank_ns0_review_H */
#ifndef DEF_agentrank_ns0_reviews_H
#define DEF_agentrank_ns0_reviews_H

/**
 *  User: marc Date: Mar 4, 2008 Time: 6:15:00 AM
 <p/>
 THIS SOFTWARE IS COPYRIGHTED.  THE SOFTWARE MAY NOT BE COPIED REPRODUCED, TRANSLATED, OR REDUCED TO ANY ELECTRONIC MEDIUM OR MACHINE READABLE FORM WITHOUT THE PRIOR WRITTEN CONSENT OF SOCO
 TECHNOLOGIES.

 */
struct agentrank_ns0_reviews {


  /**
   * (no documentation provided)
   */
  int *start_index;

  /**
   * (no documentation provided)
   */
  int *max_results;

  /**
   * (no documentation provided)
   */
  int *last_index;

  /**
   * (no documentation provided)
   */
  int *total_results;

  /**
   * (no documentation provided)
   */
  int *first_index;

  /**
   * ratio
   */
  xmlChar *satisfied;

  /**
   * ratio
   */
  xmlChar *recommend;

  /**
   * list of client reviews
   */
  struct agentrank_ns0_review *review;

  /**
   * Size of the review array.
   */
  int _sizeof_review;
};

/**
 * Reads a Reviews element from XML. The element to be read is "reviews", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Reviews, or NULL in case of error.
 */
struct agentrank_ns0_reviews *xml_read_agentrank_ns0_reviews(xmlTextReaderPtr reader);

/**
 * Writes a Reviews to XML under element name "reviews".
 *
 * @param writer The XML writer.
 * @param _reviews The Reviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
int xml_write_agentrank_ns0_reviews(xmlTextWriterPtr writer, struct agentrank_ns0_reviews *_reviews);

/**
 * Frees a Reviews.
 *
 * @param _reviews The Reviews to free.
 */
void free_agentrank_ns0_reviews(struct agentrank_ns0_reviews *_reviews);

/**
 * Reads a Reviews element from XML. The element to be read is "reviews", and
 * it is assumed that the reader is already pointing to the element.
 *
 * @param reader The XML reader.
 * @return The Reviews, or NULL in case of error.
 */
struct agentrank_ns0_reviews *xmlTextReaderReadNs0ReviewsElement(xmlTextReaderPtr reader);

/**
 * Writes a Reviews to XML under element name "reviews".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _reviews The Reviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ReviewsElement(xmlTextWriterPtr writer, struct agentrank_ns0_reviews *_reviews);

/**
 * Writes a Reviews to XML under element name "reviews".
 *
 * @param writer The XML writer.
 * @param _reviews The Reviews to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ReviewsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_reviews *_reviews, int writeNamespaces);

/**
 * Frees the children of a Reviews.
 *
 * @param _reviews The Reviews whose children are to be free.
 */
static void freeNs0ReviewsElement(struct agentrank_ns0_reviews *_reviews);

/**
 * Reads a Reviews from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The Reviews, or NULL in case of error.
 */
static struct agentrank_ns0_reviews *xmlTextReaderReadNs0ReviewsType(xmlTextReaderPtr reader);

/**
 * Writes a Reviews to XML.
 *
 * @param writer The XML writer.
 * @param _reviews The Reviews to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0ReviewsType(xmlTextWriterPtr writer, struct agentrank_ns0_reviews *_reviews);

/**
 * Frees the elements of a Reviews.
 *
 * @param _reviews The Reviews to free.
 */
static void freeNs0ReviewsType(struct agentrank_ns0_reviews *_reviews);

#endif /* DEF_agentrank_ns0_reviews_H */
#ifndef DEF_agentrank_ns0_user_H
#define DEF_agentrank_ns0_user_H

/**
 *  Created by IntelliJ IDEA. User: marc Date: Dec 29, 2010 Time: 5:28:52 AM

 */
struct agentrank_ns0_user {


  /**
   * password
   */
  xmlChar *email;

  /**
   * (no documentation provided)
   */
  xmlChar *last_name;

  /**
   * (no documentation provided)
   */
  xmlChar *first_name;
};

/**
 * Reads a User from XML. The reader is assumed to be at the start element.
 *
 * @param reader The XML reader.
 * @return The User, or NULL in case of error.
 */
static struct agentrank_ns0_user *xmlTextReaderReadNs0UserType(xmlTextReaderPtr reader);

/**
 * Writes a User to XML.
 *
 * @param writer The XML writer.
 * @param _user The User to write.
 * @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
 */
static int xmlTextWriterWriteNs0UserType(xmlTextWriterPtr writer, struct agentrank_ns0_user *_user);

/**
 * Frees the elements of a User.
 *
 * @param _user The User to free.
 */
static void freeNs0UserType(struct agentrank_ns0_user *_user);

#endif /* DEF_agentrank_ns0_user_H */
#ifndef DEF_agentrank_ns0_agents_M
#define DEF_agentrank_ns0_agents_M

/**
 * Reads a Agents element from XML. The element to be read is "agents", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Agents, or NULL in case of error.
 */
struct agentrank_ns0_agents *xml_read_agentrank_ns0_agents(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0AgentsElement(reader);
}

/**
 * Writes a Agents to XML under element name "agents".
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_agents(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents) {
  return xmlTextWriterWriteNs0AgentsElementNS(writer, _agents, 1);
}

/**
 * Frees a Agents.
 *
 * @param _agents The Agents to free.
 */
void free_agentrank_ns0_agents(struct agentrank_ns0_agents *_agents) {
  freeNs0AgentsType(_agents);
  free(_agents);
}

/**
 * Reads a Agents element from XML. The element to be read is "agents", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Agents, or NULL in case of error.
 */
struct agentrank_ns0_agents *xmlTextReaderReadNs0AgentsElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_agents *_agents = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "agents", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}agents.\n");
#endif
    _agents = xmlTextReaderReadNs0AgentsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_agents == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}agents failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}agents failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _agents;
}

/**
 * Writes a Agents to XML under element name "agents".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0AgentsElement(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents) {
  return xmlTextWriterWriteNs0AgentsElementNS(writer, _agents, 0);
}

/**
 * Writes a Agents to XML under element name "agents".
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0AgentsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "agents", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}agents. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}agents for root element {}agents...\n");
#endif
  status = xmlTextWriterWriteNs0AgentsType(writer, _agents);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}agents. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}agents. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Agents.
 *
 * @param _agents The Agents whose children are to be free.
 */
static void freeNs0AgentsElement(struct agentrank_ns0_agents *_agents) {
  freeNs0AgentsType(_agents);
}

/**
 * Reads a Agents from XML. The reader is assumed to be at the start element.
 *
 * @return the Agents, or NULL in case of error.
 */
static struct agentrank_ns0_agents *xmlTextReaderReadNs0AgentsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_agents *_agents = calloc(1, sizeof(struct agentrank_ns0_agents));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0AgentsType(_agents);
        free(_agents);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "agent", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}agent of type {}agent.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0AgentType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}agent of type {}agent.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentsType(_agents);
          free(_agents);
          return NULL;
        }

        _agents->agent = realloc(_agents->agent, (_agents->_sizeof_agent + 1) * sizeof(struct agentrank_ns0_agent));
        memcpy(&(_agents->agent[_agents->_sizeof_agent++]), _child_accessor, sizeof(struct agentrank_ns0_agent));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}agents.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}agents. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _agents;
}

/**
 * Writes a Agents to XML.
 *
 * @param writer The XML writer.
 * @param _agents The Agents to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0AgentsType(xmlTextWriterPtr writer, struct agentrank_ns0_agents *_agents) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  for (i = 0; i < _agents->_sizeof_agent; i++) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "agent", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}agent for element {}agent...\n");
#endif
    status = xmlTextWriterWriteNs0AgentType(writer, &(_agents->agent[i]));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}agent for element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Agents.
 *
 * @param _agents The Agents to free.
 */
static void freeNs0AgentsType(struct agentrank_ns0_agents *_agents) {
  int i;
  if (_agents->agent != NULL) {
    for (i = 0; i < _agents->_sizeof_agent; i++) {
#if DEBUG_ENUNCIATE > 1
      printf("Freeing accessor agent[%i] of type agentrank_ns0_agents...\n", i);
#endif
      freeNs0AgentType(&(_agents->agent[i]));
    }
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor agent of type agentrank_ns0_agents...\n");
#endif
    free(_agents->agent);
  }
}
#endif /* DEF_agentrank_ns0_agents_M */
#ifndef DEF_agentrank_ns0_contactAgent_M
#define DEF_agentrank_ns0_contactAgent_M

/**
 * Reads a ContactAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The ContactAgent, or NULL in case of error.
 */
struct agentrank_ns0_contactAgent *xml_read_agentrank_ns0_contactAgent(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a ContactAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_contactAgent(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _contactAgent, 1);
}

/**
 * Frees a ContactAgent.
 *
 * @param _contactAgent The ContactAgent to free.
 */
void free_agentrank_ns0_contactAgent(struct agentrank_ns0_contactAgent *_contactAgent) {
  freeNs0ContactAgentType(_contactAgent);
  free(_contactAgent);
}

/**
 * Reads a ContactAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The ContactAgent, or NULL in case of error.
 */
struct agentrank_ns0_contactAgent *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_contactAgent *_contactAgent = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _contactAgent = xmlTextReaderReadNs0ContactAgentType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_contactAgent == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _contactAgent;
}

/**
 * Writes a ContactAgent to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _contactAgent, 0);
}

/**
 * Writes a ContactAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}contactAgent for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0ContactAgentType(writer, _contactAgent);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a ContactAgent.
 *
 * @param _contactAgent The ContactAgent whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_contactAgent *_contactAgent) {
  freeNs0ContactAgentType(_contactAgent);
}

/**
 * Reads a ContactAgent from XML. The reader is assumed to be at the start element.
 *
 * @return the ContactAgent, or NULL in case of error.
 */
static struct agentrank_ns0_contactAgent *xmlTextReaderReadNs0ContactAgentType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_contactAgent *_contactAgent = calloc(1, sizeof(struct agentrank_ns0_contactAgent));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ContactAgentType(_contactAgent);
        free(_contactAgent);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ContactAgentType(_contactAgent);
          free(_contactAgent);
          return NULL;
        }

        _contactAgent->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}contactAgent.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}contactAgent. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _contactAgent;
}

/**
 * Writes a ContactAgent to XML.
 *
 * @param writer The XML writer.
 * @param _contactAgent The ContactAgent to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ContactAgentType(xmlTextWriterPtr writer, struct agentrank_ns0_contactAgent *_contactAgent) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_contactAgent->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_contactAgent->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a ContactAgent.
 *
 * @param _contactAgent The ContactAgent to free.
 */
static void freeNs0ContactAgentType(struct agentrank_ns0_contactAgent *_contactAgent) {
  int i;
  if (_contactAgent->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_contactAgent...\n");
#endif
    freeNs0StatusType(_contactAgent->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_contactAgent...\n");
#endif
    free(_contactAgent->status);
  }
}
#endif /* DEF_agentrank_ns0_contactAgent_M */
#ifndef DEF_agentrank_ns0_findAgents_M
#define DEF_agentrank_ns0_findAgents_M

/**
 * Reads a FindAgents element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The FindAgents, or NULL in case of error.
 */
struct agentrank_ns0_findAgents *xml_read_agentrank_ns0_findAgents(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a FindAgents to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_findAgents(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _findAgents, 1);
}

/**
 * Frees a FindAgents.
 *
 * @param _findAgents The FindAgents to free.
 */
void free_agentrank_ns0_findAgents(struct agentrank_ns0_findAgents *_findAgents) {
  freeNs0FindAgentsType(_findAgents);
  free(_findAgents);
}

/**
 * Reads a FindAgents element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The FindAgents, or NULL in case of error.
 */
struct agentrank_ns0_findAgents *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_findAgents *_findAgents = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _findAgents = xmlTextReaderReadNs0FindAgentsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_findAgents == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _findAgents;
}

/**
 * Writes a FindAgents to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _findAgents, 0);
}

/**
 * Writes a FindAgents to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}findAgents for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0FindAgentsType(writer, _findAgents);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a FindAgents.
 *
 * @param _findAgents The FindAgents whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_findAgents *_findAgents) {
  freeNs0FindAgentsType(_findAgents);
}

/**
 * Reads a FindAgents from XML. The reader is assumed to be at the start element.
 *
 * @return the FindAgents, or NULL in case of error.
 */
static struct agentrank_ns0_findAgents *xmlTextReaderReadNs0FindAgentsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_findAgents *_findAgents = calloc(1, sizeof(struct agentrank_ns0_findAgents));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0FindAgentsType(_findAgents);
        free(_findAgents);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "agents", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}agents of type {}agents.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0AgentsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}agents of type {}agents.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0FindAgentsType(_findAgents);
          free(_findAgents);
          return NULL;
        }

        _findAgents->agents = ((struct agentrank_ns0_agents*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0FindAgentsType(_findAgents);
          free(_findAgents);
          return NULL;
        }

        _findAgents->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}findAgents.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}findAgents. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _findAgents;
}

/**
 * Writes a FindAgents to XML.
 *
 * @param writer The XML writer.
 * @param _findAgents The FindAgents to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0FindAgentsType(xmlTextWriterPtr writer, struct agentrank_ns0_findAgents *_findAgents) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_findAgents->agents != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "agents", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}agents. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}agents for element {}agents...\n");
#endif
    status = xmlTextWriterWriteNs0AgentsType(writer, (_findAgents->agents));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}agents for element {}agents. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}agents. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_findAgents->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_findAgents->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a FindAgents.
 *
 * @param _findAgents The FindAgents to free.
 */
static void freeNs0FindAgentsType(struct agentrank_ns0_findAgents *_findAgents) {
  int i;
  if (_findAgents->agents != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor agents of type agentrank_ns0_findAgents...\n");
#endif
    freeNs0AgentsType(_findAgents->agents);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor agents of type agentrank_ns0_findAgents...\n");
#endif
    free(_findAgents->agents);
  }
  if (_findAgents->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_findAgents...\n");
#endif
    freeNs0StatusType(_findAgents->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_findAgents...\n");
#endif
    free(_findAgents->status);
  }
}
#endif /* DEF_agentrank_ns0_findAgents_M */
#ifndef DEF_agentrank_ns0_getAgent_M
#define DEF_agentrank_ns0_getAgent_M

/**
 * Reads a GetAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetAgent, or NULL in case of error.
 */
struct agentrank_ns0_getAgent *xml_read_agentrank_ns0_getAgent(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getAgent(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getAgent, 1);
}

/**
 * Frees a GetAgent.
 *
 * @param _getAgent The GetAgent to free.
 */
void free_agentrank_ns0_getAgent(struct agentrank_ns0_getAgent *_getAgent) {
  freeNs0GetAgentType(_getAgent);
  free(_getAgent);
}

/**
 * Reads a GetAgent element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetAgent, or NULL in case of error.
 */
struct agentrank_ns0_getAgent *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getAgent *_getAgent = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getAgent = xmlTextReaderReadNs0GetAgentType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getAgent == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getAgent;
}

/**
 * Writes a GetAgent to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getAgent, 0);
}

/**
 * Writes a GetAgent to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getAgent for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetAgentType(writer, _getAgent);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetAgent.
 *
 * @param _getAgent The GetAgent whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getAgent *_getAgent) {
  freeNs0GetAgentType(_getAgent);
}

/**
 * Reads a GetAgent from XML. The reader is assumed to be at the start element.
 *
 * @return the GetAgent, or NULL in case of error.
 */
static struct agentrank_ns0_getAgent *xmlTextReaderReadNs0GetAgentType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getAgent *_getAgent = calloc(1, sizeof(struct agentrank_ns0_getAgent));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetAgentType(_getAgent);
        free(_getAgent);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "agent", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}agent of type {}agent.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0AgentType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}agent of type {}agent.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetAgentType(_getAgent);
          free(_getAgent);
          return NULL;
        }

        _getAgent->agent = ((struct agentrank_ns0_agent*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetAgentType(_getAgent);
          free(_getAgent);
          return NULL;
        }

        _getAgent->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getAgent.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getAgent. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getAgent;
}

/**
 * Writes a GetAgent to XML.
 *
 * @param writer The XML writer.
 * @param _getAgent The GetAgent to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetAgentType(xmlTextWriterPtr writer, struct agentrank_ns0_getAgent *_getAgent) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getAgent->agent != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "agent", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}agent for element {}agent...\n");
#endif
    status = xmlTextWriterWriteNs0AgentType(writer, (_getAgent->agent));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}agent for element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}agent. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getAgent->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getAgent->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetAgent.
 *
 * @param _getAgent The GetAgent to free.
 */
static void freeNs0GetAgentType(struct agentrank_ns0_getAgent *_getAgent) {
  int i;
  if (_getAgent->agent != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor agent of type agentrank_ns0_getAgent...\n");
#endif
    freeNs0AgentType(_getAgent->agent);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor agent of type agentrank_ns0_getAgent...\n");
#endif
    free(_getAgent->agent);
  }
  if (_getAgent->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getAgent...\n");
#endif
    freeNs0StatusType(_getAgent->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getAgent...\n");
#endif
    free(_getAgent->status);
  }
}
#endif /* DEF_agentrank_ns0_getAgent_M */
#ifndef DEF_agentrank_ns0_getMarket_M
#define DEF_agentrank_ns0_getMarket_M

/**
 * Reads a GetMarket element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetMarket, or NULL in case of error.
 */
struct agentrank_ns0_getMarket *xml_read_agentrank_ns0_getMarket(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetMarket to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getMarket(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getMarket, 1);
}

/**
 * Frees a GetMarket.
 *
 * @param _getMarket The GetMarket to free.
 */
void free_agentrank_ns0_getMarket(struct agentrank_ns0_getMarket *_getMarket) {
  freeNs0GetMarketType(_getMarket);
  free(_getMarket);
}

/**
 * Reads a GetMarket element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetMarket, or NULL in case of error.
 */
struct agentrank_ns0_getMarket *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getMarket *_getMarket = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getMarket = xmlTextReaderReadNs0GetMarketType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getMarket == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getMarket;
}

/**
 * Writes a GetMarket to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getMarket, 0);
}

/**
 * Writes a GetMarket to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getMarket for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetMarketType(writer, _getMarket);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetMarket.
 *
 * @param _getMarket The GetMarket whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getMarket *_getMarket) {
  freeNs0GetMarketType(_getMarket);
}

/**
 * Reads a GetMarket from XML. The reader is assumed to be at the start element.
 *
 * @return the GetMarket, or NULL in case of error.
 */
static struct agentrank_ns0_getMarket *xmlTextReaderReadNs0GetMarketType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getMarket *_getMarket = calloc(1, sizeof(struct agentrank_ns0_getMarket));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetMarketType(_getMarket);
        free(_getMarket);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "market", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}market of type {}market.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0MarketType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}market of type {}market.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetMarketType(_getMarket);
          free(_getMarket);
          return NULL;
        }

        _getMarket->market = ((struct agentrank_ns0_market*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetMarketType(_getMarket);
          free(_getMarket);
          return NULL;
        }

        _getMarket->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getMarket.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getMarket. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getMarket;
}

/**
 * Writes a GetMarket to XML.
 *
 * @param writer The XML writer.
 * @param _getMarket The GetMarket to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetMarketType(xmlTextWriterPtr writer, struct agentrank_ns0_getMarket *_getMarket) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getMarket->market != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "market", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}market for element {}market...\n");
#endif
    status = xmlTextWriterWriteNs0MarketType(writer, (_getMarket->market));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}market for element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getMarket->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getMarket->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetMarket.
 *
 * @param _getMarket The GetMarket to free.
 */
static void freeNs0GetMarketType(struct agentrank_ns0_getMarket *_getMarket) {
  int i;
  if (_getMarket->market != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor market of type agentrank_ns0_getMarket...\n");
#endif
    freeNs0MarketType(_getMarket->market);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor market of type agentrank_ns0_getMarket...\n");
#endif
    free(_getMarket->market);
  }
  if (_getMarket->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getMarket...\n");
#endif
    freeNs0StatusType(_getMarket->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getMarket...\n");
#endif
    free(_getMarket->status);
  }
}
#endif /* DEF_agentrank_ns0_getMarket_M */
#ifndef DEF_agentrank_ns0_histories_M
#define DEF_agentrank_ns0_histories_M

/**
 * Reads a Histories from XML. The reader is assumed to be at the start element.
 *
 * @return the Histories, or NULL in case of error.
 */
static struct agentrank_ns0_histories *xmlTextReaderReadNs0HistoriesType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_histories *_histories = calloc(1, sizeof(struct agentrank_ns0_histories));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0HistoriesType(_histories);
        free(_histories);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "chart", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}chart of type {}image.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImageType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}chart of type {}image.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoriesType(_histories);
          free(_histories);
          return NULL;
        }

        _histories->chart = ((struct agentrank_ns0_image*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "history", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}history of type {}history.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0HistoryType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}history of type {}history.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoriesType(_histories);
          free(_histories);
          return NULL;
        }

        _histories->history = realloc(_histories->history, (_histories->_sizeof_history + 1) * sizeof(struct agentrank_ns0_history));
        memcpy(&(_histories->history[_histories->_sizeof_history++]), _child_accessor, sizeof(struct agentrank_ns0_history));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}histories.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}histories. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _histories;
}

/**
 * Writes a Histories to XML.
 *
 * @param writer The XML writer.
 * @param _histories The Histories to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0HistoriesType(xmlTextWriterPtr writer, struct agentrank_ns0_histories *_histories) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_histories->chart != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "chart", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}chart. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}image for element {}chart...\n");
#endif
    status = xmlTextWriterWriteNs0ImageType(writer, (_histories->chart));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}image for element {}chart. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}chart. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  for (i = 0; i < _histories->_sizeof_history; i++) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "history", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}history. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}history for element {}history...\n");
#endif
    status = xmlTextWriterWriteNs0HistoryType(writer, &(_histories->history[i]));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}history for element {}history. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}history. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Histories.
 *
 * @param _histories The Histories to free.
 */
static void freeNs0HistoriesType(struct agentrank_ns0_histories *_histories) {
  int i;
  if (_histories->chart != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor chart of type agentrank_ns0_histories...\n");
#endif
    freeNs0ImageType(_histories->chart);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor chart of type agentrank_ns0_histories...\n");
#endif
    free(_histories->chart);
  }
  if (_histories->history != NULL) {
    for (i = 0; i < _histories->_sizeof_history; i++) {
#if DEBUG_ENUNCIATE > 1
      printf("Freeing accessor history[%i] of type agentrank_ns0_histories...\n", i);
#endif
      freeNs0HistoryType(&(_histories->history[i]));
    }
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor history of type agentrank_ns0_histories...\n");
#endif
    free(_histories->history);
  }
}
#endif /* DEF_agentrank_ns0_histories_M */
#ifndef DEF_agentrank_ns0_history_M
#define DEF_agentrank_ns0_history_M

/**
 * Reads a History from XML. The reader is assumed to be at the start element.
 *
 * @return the History, or NULL in case of error.
 */
static struct agentrank_ns0_history *xmlTextReaderReadNs0HistoryType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_history *_history = calloc(1, sizeof(struct agentrank_ns0_history));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0HistoryType(_history);
        free(_history);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "date", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}date of type {http://www.w3.org/2001/XMLSchema}dateTime.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDateTimeType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}date of type {http://www.w3.org/2001/XMLSchema}dateTime.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoryType(_history);
          free(_history);
          return NULL;
        }

        _history->date = ((struct tm*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "market", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}market of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}market of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoryType(_history);
          free(_history);
          return NULL;
        }

        _history->market = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "metric", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}metric of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}metric of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoryType(_history);
          free(_history);
          return NULL;
        }

        _history->metric = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}value of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDecimalType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}value of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0HistoryType(_history);
          free(_history);
          return NULL;
        }

        _history->value = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}history.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}history. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _history;
}

/**
 * Writes a History to XML.
 *
 * @param writer The XML writer.
 * @param _history The History to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0HistoryType(xmlTextWriterPtr writer, struct agentrank_ns0_history *_history) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_history->date != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "date", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}date...\n");
#endif
    status = xmlTextWriterWriteXsDateTimeType(writer, (_history->date));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_history->market != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "market", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}market...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_history->market));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_history->metric != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "metric", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}metric...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_history->metric));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_history->value != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "value", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}value. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}value...\n");
#endif
    status = xmlTextWriterWriteXsDecimalType(writer, (_history->value));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}value. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}value. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a History.
 *
 * @param _history The History to free.
 */
static void freeNs0HistoryType(struct agentrank_ns0_history *_history) {
  int i;
  if (_history->date != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor date of type agentrank_ns0_history...\n");
#endif
    freeXsDateTimeType(_history->date);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor date of type agentrank_ns0_history...\n");
#endif
    free(_history->date);
  }
  if (_history->market != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor market of type agentrank_ns0_history...\n");
#endif
    freeXsStringType(_history->market);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor market of type agentrank_ns0_history...\n");
#endif
    free(_history->market);
  }
  if (_history->metric != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor metric of type agentrank_ns0_history...\n");
#endif
    freeXsStringType(_history->metric);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor metric of type agentrank_ns0_history...\n");
#endif
    free(_history->metric);
  }
  if (_history->value != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor value of type agentrank_ns0_history...\n");
#endif
    freeXsDecimalType(_history->value);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor value of type agentrank_ns0_history...\n");
#endif
    free(_history->value);
  }
}
#endif /* DEF_agentrank_ns0_history_M */
#ifndef DEF_agentrank_ns0_location_M
#define DEF_agentrank_ns0_location_M

/**
 * Reads a Location from XML. The reader is assumed to be at the start element.
 *
 * @return the Location, or NULL in case of error.
 */
static struct agentrank_ns0_location *xmlTextReaderReadNs0LocationType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_location *_location = calloc(1, sizeof(struct agentrank_ns0_location));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0LocationType(_location);
        free(_location);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}id of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}id of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0LocationType(_location);
          free(_location);
          return NULL;
        }

        _location->id = *((int*)_child_accessor);
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}type of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}type of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0LocationType(_location);
          free(_location);
          return NULL;
        }

        _location->type = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0LocationType(_location);
          free(_location);
          return NULL;
        }

        _location->name = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}location.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}location. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _location;
}

/**
 * Writes a Location to XML.
 *
 * @param writer The XML writer.
 * @param _location The Location to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0LocationType(xmlTextWriterPtr writer, struct agentrank_ns0_location *_location) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (1) { //always write the primitive element.
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "id", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}id...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, &(_location->id));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_location->type != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "type", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}type. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}type...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_location->type));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}type. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}type. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_location->name != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_location->name));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Location.
 *
 * @param _location The Location to free.
 */
static void freeNs0LocationType(struct agentrank_ns0_location *_location) {
  int i;
  if (_location->type != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor type of type agentrank_ns0_location...\n");
#endif
    freeXsStringType(_location->type);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor type of type agentrank_ns0_location...\n");
#endif
    free(_location->type);
  }
  if (_location->name != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor name of type agentrank_ns0_location...\n");
#endif
    freeXsStringType(_location->name);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor name of type agentrank_ns0_location...\n");
#endif
    free(_location->name);
  }
}
#endif /* DEF_agentrank_ns0_location_M */
#ifndef DEF_agentrank_ns0_locations_M
#define DEF_agentrank_ns0_locations_M

/**
 * Reads a Locations element from XML. The element to be read is "locations", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Locations, or NULL in case of error.
 */
struct agentrank_ns0_locations *xml_read_agentrank_ns0_locations(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0LocationsElement(reader);
}

/**
 * Writes a Locations to XML under element name "locations".
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_locations(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations) {
  return xmlTextWriterWriteNs0LocationsElementNS(writer, _locations, 1);
}

/**
 * Frees a Locations.
 *
 * @param _locations The Locations to free.
 */
void free_agentrank_ns0_locations(struct agentrank_ns0_locations *_locations) {
  freeNs0LocationsType(_locations);
  free(_locations);
}

/**
 * Reads a Locations element from XML. The element to be read is "locations", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Locations, or NULL in case of error.
 */
struct agentrank_ns0_locations *xmlTextReaderReadNs0LocationsElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_locations *_locations = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "locations", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}locations.\n");
#endif
    _locations = xmlTextReaderReadNs0LocationsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_locations == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}locations failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}locations failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _locations;
}

/**
 * Writes a Locations to XML under element name "locations".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0LocationsElement(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations) {
  return xmlTextWriterWriteNs0LocationsElementNS(writer, _locations, 0);
}

/**
 * Writes a Locations to XML under element name "locations".
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0LocationsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "locations", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}locations. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}locations for root element {}locations...\n");
#endif
  status = xmlTextWriterWriteNs0LocationsType(writer, _locations);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}locations. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}locations. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Locations.
 *
 * @param _locations The Locations whose children are to be free.
 */
static void freeNs0LocationsElement(struct agentrank_ns0_locations *_locations) {
  freeNs0LocationsType(_locations);
}

/**
 * Reads a Locations from XML. The reader is assumed to be at the start element.
 *
 * @return the Locations, or NULL in case of error.
 */
static struct agentrank_ns0_locations *xmlTextReaderReadNs0LocationsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_locations *_locations = calloc(1, sizeof(struct agentrank_ns0_locations));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0LocationsType(_locations);
        free(_locations);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "location", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}location of type {}location.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0LocationType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}location of type {}location.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0LocationsType(_locations);
          free(_locations);
          return NULL;
        }

        _locations->location = realloc(_locations->location, (_locations->_sizeof_location + 1) * sizeof(struct agentrank_ns0_location));
        memcpy(&(_locations->location[_locations->_sizeof_location++]), _child_accessor, sizeof(struct agentrank_ns0_location));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}locations.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}locations. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _locations;
}

/**
 * Writes a Locations to XML.
 *
 * @param writer The XML writer.
 * @param _locations The Locations to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0LocationsType(xmlTextWriterPtr writer, struct agentrank_ns0_locations *_locations) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  for (i = 0; i < _locations->_sizeof_location; i++) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "location", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}location. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}location for element {}location...\n");
#endif
    status = xmlTextWriterWriteNs0LocationType(writer, &(_locations->location[i]));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}location for element {}location. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}location. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Locations.
 *
 * @param _locations The Locations to free.
 */
static void freeNs0LocationsType(struct agentrank_ns0_locations *_locations) {
  int i;
  if (_locations->location != NULL) {
    for (i = 0; i < _locations->_sizeof_location; i++) {
#if DEBUG_ENUNCIATE > 1
      printf("Freeing accessor location[%i] of type agentrank_ns0_locations...\n", i);
#endif
      freeNs0LocationType(&(_locations->location[i]));
    }
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor location of type agentrank_ns0_locations...\n");
#endif
    free(_locations->location);
  }
}
#endif /* DEF_agentrank_ns0_locations_M */
#ifndef DEF_agentrank_ns0_market_M
#define DEF_agentrank_ns0_market_M

/**
 * Reads a Market element from XML. The element to be read is "market", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Market, or NULL in case of error.
 */
struct agentrank_ns0_market *xml_read_agentrank_ns0_market(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0MarketElement(reader);
}

/**
 * Writes a Market to XML under element name "market".
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_market(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market) {
  return xmlTextWriterWriteNs0MarketElementNS(writer, _market, 1);
}

/**
 * Frees a Market.
 *
 * @param _market The Market to free.
 */
void free_agentrank_ns0_market(struct agentrank_ns0_market *_market) {
  freeNs0MarketType(_market);
  free(_market);
}

/**
 * Reads a Market element from XML. The element to be read is "market", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Market, or NULL in case of error.
 */
struct agentrank_ns0_market *xmlTextReaderReadNs0MarketElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_market *_market = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "market", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}market.\n");
#endif
    _market = xmlTextReaderReadNs0MarketType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_market == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}market failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}market failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _market;
}

/**
 * Writes a Market to XML under element name "market".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0MarketElement(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market) {
  return xmlTextWriterWriteNs0MarketElementNS(writer, _market, 0);
}

/**
 * Writes a Market to XML under element name "market".
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0MarketElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "market", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}market. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}market for root element {}market...\n");
#endif
  status = xmlTextWriterWriteNs0MarketType(writer, _market);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}market. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}market. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Market.
 *
 * @param _market The Market whose children are to be free.
 */
static void freeNs0MarketElement(struct agentrank_ns0_market *_market) {
  freeNs0MarketType(_market);
}

/**
 * Reads a Market from XML. The reader is assumed to be at the start element.
 *
 * @return the Market, or NULL in case of error.
 */
static struct agentrank_ns0_market *xmlTextReaderReadNs0MarketType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_market *_market = calloc(1, sizeof(struct agentrank_ns0_market));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0MarketType(_market);
        free(_market);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0MarketType(_market);
          free(_market);
          return NULL;
        }

        _market->name = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecasts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecasts of type {}forecasts.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ForecastsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecasts of type {}forecasts.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0MarketType(_market);
          free(_market);
          return NULL;
        }

        _market->forecasts = ((struct agentrank_ns0_forecasts*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "histories", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}histories of type {}histories.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0HistoriesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}histories of type {}histories.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0MarketType(_market);
          free(_market);
          return NULL;
        }

        _market->histories = ((struct agentrank_ns0_histories*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}market.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}market. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _market;
}

/**
 * Writes a Market to XML.
 *
 * @param writer The XML writer.
 * @param _market The Market to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0MarketType(xmlTextWriterPtr writer, struct agentrank_ns0_market *_market) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_market->name != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}name...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_market->name));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_market->forecasts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecasts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}forecasts for element {}forecasts...\n");
#endif
    status = xmlTextWriterWriteNs0ForecastsType(writer, (_market->forecasts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}forecasts for element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_market->histories != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "histories", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}histories. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}histories for element {}histories...\n");
#endif
    status = xmlTextWriterWriteNs0HistoriesType(writer, (_market->histories));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}histories for element {}histories. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}histories. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Market.
 *
 * @param _market The Market to free.
 */
static void freeNs0MarketType(struct agentrank_ns0_market *_market) {
  int i;
  if (_market->name != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor name of type agentrank_ns0_market...\n");
#endif
    freeXsStringType(_market->name);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor name of type agentrank_ns0_market...\n");
#endif
    free(_market->name);
  }
  if (_market->forecasts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor forecasts of type agentrank_ns0_market...\n");
#endif
    freeNs0ForecastsType(_market->forecasts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecasts of type agentrank_ns0_market...\n");
#endif
    free(_market->forecasts);
  }
  if (_market->histories != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor histories of type agentrank_ns0_market...\n");
#endif
    freeNs0HistoriesType(_market->histories);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor histories of type agentrank_ns0_market...\n");
#endif
    free(_market->histories);
  }
}
#endif /* DEF_agentrank_ns0_market_M */
#ifndef DEF_agentrank_ns0_photoSize_M
#define DEF_agentrank_ns0_photoSize_M

/**
 * Reads a PhotoSize element from XML. The element to be read is "photoSize", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PhotoSize, or NULL in case of error.
 */
struct agentrank_ns0_photoSize *xml_read_agentrank_ns0_photoSize(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0PhotoSizeElement(reader);
}

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_photoSize(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize) {
  return xmlTextWriterWriteNs0PhotoSizeElementNS(writer, _photoSize, 1);
}

/**
 * Frees a PhotoSize.
 *
 * @param _photoSize The PhotoSize to free.
 */
void free_agentrank_ns0_photoSize(struct agentrank_ns0_photoSize *_photoSize) {
  freeNs0PhotoSizeType(_photoSize);
  free(_photoSize);
}

/**
 * Reads a PhotoSize element from XML. The element to be read is "photoSize", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The PhotoSize, or NULL in case of error.
 */
struct agentrank_ns0_photoSize *xmlTextReaderReadNs0PhotoSizeElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_photoSize *_photoSize = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "photoSize", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}photoSize.\n");
#endif
    _photoSize = xmlTextReaderReadNs0PhotoSizeType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_photoSize == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}photoSize failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}photoSize failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _photoSize;
}

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0PhotoSizeElement(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize) {
  return xmlTextWriterWriteNs0PhotoSizeElementNS(writer, _photoSize, 0);
}

/**
 * Writes a PhotoSize to XML under element name "photoSize".
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0PhotoSizeElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "photoSize", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}photoSize. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}photoSize for root element {}photoSize...\n");
#endif
  status = xmlTextWriterWriteNs0PhotoSizeType(writer, _photoSize);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}photoSize. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}photoSize. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a PhotoSize.
 *
 * @param _photoSize The PhotoSize whose children are to be free.
 */
static void freeNs0PhotoSizeElement(struct agentrank_ns0_photoSize *_photoSize) {
  freeNs0PhotoSizeType(_photoSize);
}

/**
 * Reads a PhotoSize from XML. The reader is assumed to be at the start element.
 *
 * @return the PhotoSize, or NULL in case of error.
 */
static struct agentrank_ns0_photoSize *xmlTextReaderReadNs0PhotoSizeType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_photoSize *_photoSize = calloc(1, sizeof(struct agentrank_ns0_photoSize));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "height", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}height...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}height of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PhotoSizeType(_photoSize);
          free(_photoSize);
          return NULL;
        }
        _photoSize->height = *((int*)_child_accessor);
        freeXsIntType((int*) _child_accessor);
        free(_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "width", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}width...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}width of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PhotoSizeType(_photoSize);
          free(_photoSize);
          return NULL;
        }
        _photoSize->width = *((int*)_child_accessor);
        freeXsIntType((int*) _child_accessor);
        free(_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}type...\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}type of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          freeNs0PhotoSizeType(_photoSize);
          free(_photoSize);
          return NULL;
        }
        _photoSize->type = ((xmlChar*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0PhotoSizeType(_photoSize);
      free(_photoSize);
      return NULL;
    }
  }



  return _photoSize;
}

/**
 * Writes a PhotoSize to XML.
 *
 * @param writer The XML writer.
 * @param _photoSize The PhotoSize to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0PhotoSizeType(xmlTextWriterPtr writer, struct agentrank_ns0_photoSize *_photoSize) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (1) { //always write the primitive attribute
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "height", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}height. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}height...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, &(_photoSize->height));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}height. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}height. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (1) { //always write the primitive attribute
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "width", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}width. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}width...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, &(_photoSize->width));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}width. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}width. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_photoSize->type != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}type. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}type...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_photoSize->type));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}type. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}type. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a PhotoSize.
 *
 * @param _photoSize The PhotoSize to free.
 */
static void freeNs0PhotoSizeType(struct agentrank_ns0_photoSize *_photoSize) {
  int i;
  if (_photoSize->type != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor type of type agentrank_ns0_photoSize...\n");
#endif
    freeXsStringType(_photoSize->type);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor type of type agentrank_ns0_photoSize...\n");
#endif
    free(_photoSize->type);
  }
}
#endif /* DEF_agentrank_ns0_photoSize_M */
#ifndef DEF_agentrank_ns0_photoSizes_M
#define DEF_agentrank_ns0_photoSizes_M

/**
 * Reads a PhotoSizes element from XML. The element to be read is "photoSizes", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PhotoSizes, or NULL in case of error.
 */
struct agentrank_ns0_photoSizes *xml_read_agentrank_ns0_photoSizes(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0PhotoSizesElement(reader);
}

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_photoSizes(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes) {
  return xmlTextWriterWriteNs0PhotoSizesElementNS(writer, _photoSizes, 1);
}

/**
 * Frees a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes to free.
 */
void free_agentrank_ns0_photoSizes(struct agentrank_ns0_photoSizes *_photoSizes) {
  freeNs0PhotoSizesType(_photoSizes);
  free(_photoSizes);
}

/**
 * Reads a PhotoSizes element from XML. The element to be read is "photoSizes", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The PhotoSizes, or NULL in case of error.
 */
struct agentrank_ns0_photoSizes *xmlTextReaderReadNs0PhotoSizesElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_photoSizes *_photoSizes = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "photoSizes", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}photoSizes.\n");
#endif
    _photoSizes = xmlTextReaderReadNs0PhotoSizesType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_photoSizes == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}photoSizes failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}photoSizes failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _photoSizes;
}

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0PhotoSizesElement(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes) {
  return xmlTextWriterWriteNs0PhotoSizesElementNS(writer, _photoSizes, 0);
}

/**
 * Writes a PhotoSizes to XML under element name "photoSizes".
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0PhotoSizesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "photoSizes", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}photoSizes. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}photoSizes for root element {}photoSizes...\n");
#endif
  status = xmlTextWriterWriteNs0PhotoSizesType(writer, _photoSizes);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}photoSizes. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}photoSizes. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes whose children are to be free.
 */
static void freeNs0PhotoSizesElement(struct agentrank_ns0_photoSizes *_photoSizes) {
  freeNs0PhotoSizesType(_photoSizes);
}

/**
 * Reads a PhotoSizes from XML. The reader is assumed to be at the start element.
 *
 * @return the PhotoSizes, or NULL in case of error.
 */
static struct agentrank_ns0_photoSizes *xmlTextReaderReadNs0PhotoSizesType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_photoSizes *_photoSizes = calloc(1, sizeof(struct agentrank_ns0_photoSizes));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0PhotoSizesType(_photoSizes);
        free(_photoSizes);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "size", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}size of type {}photoSize.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0PhotoSizeType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}size of type {}photoSize.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0PhotoSizesType(_photoSizes);
          free(_photoSizes);
          return NULL;
        }

        _photoSizes->size = realloc(_photoSizes->size, (_photoSizes->_sizeof_size + 1) * sizeof(struct agentrank_ns0_photoSize));
        memcpy(&(_photoSizes->size[_photoSizes->_sizeof_size++]), _child_accessor, sizeof(struct agentrank_ns0_photoSize));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}photoSizes.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}photoSizes. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _photoSizes;
}

/**
 * Writes a PhotoSizes to XML.
 *
 * @param writer The XML writer.
 * @param _photoSizes The PhotoSizes to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0PhotoSizesType(xmlTextWriterPtr writer, struct agentrank_ns0_photoSizes *_photoSizes) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  for (i = 0; i < _photoSizes->_sizeof_size; i++) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "size", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}size. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}photoSize for element {}size...\n");
#endif
    status = xmlTextWriterWriteNs0PhotoSizeType(writer, &(_photoSizes->size[i]));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}photoSize for element {}size. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}size. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a PhotoSizes.
 *
 * @param _photoSizes The PhotoSizes to free.
 */
static void freeNs0PhotoSizesType(struct agentrank_ns0_photoSizes *_photoSizes) {
  int i;
  if (_photoSizes->size != NULL) {
    for (i = 0; i < _photoSizes->_sizeof_size; i++) {
#if DEBUG_ENUNCIATE > 1
      printf("Freeing accessor size[%i] of type agentrank_ns0_photoSizes...\n", i);
#endif
      freeNs0PhotoSizeType(&(_photoSizes->size[i]));
    }
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor size of type agentrank_ns0_photoSizes...\n");
#endif
    free(_photoSizes->size);
  }
}
#endif /* DEF_agentrank_ns0_photoSizes_M */
#ifndef DEF_agentrank_ns0_pagedList_M
#define DEF_agentrank_ns0_pagedList_M

/**
 * Reads a PagedList from XML. The reader is assumed to be at the start element.
 *
 * @return the PagedList, or NULL in case of error.
 */
static struct agentrank_ns0_pagedList *xmlTextReaderReadNs0PagedListType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_pagedList *_pagedList = calloc(1, sizeof(struct agentrank_ns0_pagedList));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "start_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}start_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}start_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PagedListType(_pagedList);
          free(_pagedList);
          return NULL;
        }
        _pagedList->start_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "max_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}max_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}max_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PagedListType(_pagedList);
          free(_pagedList);
          return NULL;
        }
        _pagedList->max_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "last_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}last_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}last_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PagedListType(_pagedList);
          free(_pagedList);
          return NULL;
        }
        _pagedList->last_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "total_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}total_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}total_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PagedListType(_pagedList);
          free(_pagedList);
          return NULL;
        }
        _pagedList->total_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "first_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}first_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}first_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0PagedListType(_pagedList);
          free(_pagedList);
          return NULL;
        }
        _pagedList->first_index = ((int*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0PagedListType(_pagedList);
      free(_pagedList);
      return NULL;
    }
  }



  return _pagedList;
}

/**
 * Writes a PagedList to XML.
 *
 * @param writer The XML writer.
 * @param _pagedList The PagedList to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0PagedListType(xmlTextWriterPtr writer, struct agentrank_ns0_pagedList *_pagedList) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_pagedList->start_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "start_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}start_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_pagedList->start_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_pagedList->max_results != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "max_results", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}max_results. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}max_results...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_pagedList->max_results));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}max_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}max_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_pagedList->last_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "last_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}last_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}last_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_pagedList->last_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}last_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}last_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_pagedList->total_results != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "total_results", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}total_results. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}total_results...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_pagedList->total_results));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}total_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}total_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_pagedList->first_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "first_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}first_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}first_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_pagedList->first_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}first_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}first_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a PagedList.
 *
 * @param _pagedList The PagedList to free.
 */
static void freeNs0PagedListType(struct agentrank_ns0_pagedList *_pagedList) {
  int i;
  if (_pagedList->start_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor start_index of type agentrank_ns0_pagedList...\n");
#endif
    freeXsIntType(_pagedList->start_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor start_index of type agentrank_ns0_pagedList...\n");
#endif
    free(_pagedList->start_index);
  }
  if (_pagedList->max_results != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor max_results of type agentrank_ns0_pagedList...\n");
#endif
    freeXsIntType(_pagedList->max_results);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor max_results of type agentrank_ns0_pagedList...\n");
#endif
    free(_pagedList->max_results);
  }
  if (_pagedList->last_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor last_index of type agentrank_ns0_pagedList...\n");
#endif
    freeXsIntType(_pagedList->last_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor last_index of type agentrank_ns0_pagedList...\n");
#endif
    free(_pagedList->last_index);
  }
  if (_pagedList->total_results != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor total_results of type agentrank_ns0_pagedList...\n");
#endif
    freeXsIntType(_pagedList->total_results);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor total_results of type agentrank_ns0_pagedList...\n");
#endif
    free(_pagedList->total_results);
  }
  if (_pagedList->first_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor first_index of type agentrank_ns0_pagedList...\n");
#endif
    freeXsIntType(_pagedList->first_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor first_index of type agentrank_ns0_pagedList...\n");
#endif
    free(_pagedList->first_index);
  }
}
#endif /* DEF_agentrank_ns0_pagedList_M */
#ifndef DEF_agentrank_ns0_agent_M
#define DEF_agentrank_ns0_agent_M

/**
 * Reads a Agent element from XML. The element to be read is "agent", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Agent, or NULL in case of error.
 */
struct agentrank_ns0_agent *xml_read_agentrank_ns0_agent(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0AgentElement(reader);
}

/**
 * Writes a Agent to XML under element name "agent".
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_agent(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent) {
  return xmlTextWriterWriteNs0AgentElementNS(writer, _agent, 1);
}

/**
 * Frees a Agent.
 *
 * @param _agent The Agent to free.
 */
void free_agentrank_ns0_agent(struct agentrank_ns0_agent *_agent) {
  freeNs0AgentType(_agent);
  free(_agent);
}

/**
 * Reads a Agent element from XML. The element to be read is "agent", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Agent, or NULL in case of error.
 */
struct agentrank_ns0_agent *xmlTextReaderReadNs0AgentElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_agent *_agent = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "agent", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}agent.\n");
#endif
    _agent = xmlTextReaderReadNs0AgentType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_agent == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}agent failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}agent failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _agent;
}

/**
 * Writes a Agent to XML under element name "agent".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0AgentElement(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent) {
  return xmlTextWriterWriteNs0AgentElementNS(writer, _agent, 0);
}

/**
 * Writes a Agent to XML under element name "agent".
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0AgentElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "agent", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}agent. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}agent for root element {}agent...\n");
#endif
  status = xmlTextWriterWriteNs0AgentType(writer, _agent);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}agent. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}agent. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Agent.
 *
 * @param _agent The Agent whose children are to be free.
 */
static void freeNs0AgentElement(struct agentrank_ns0_agent *_agent) {
  freeNs0AgentType(_agent);
}

/**
 * Reads a Agent from XML. The reader is assumed to be at the start element.
 *
 * @return the Agent, or NULL in case of error.
 */
static struct agentrank_ns0_agent *xmlTextReaderReadNs0AgentType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_agent *_agent = calloc(1, sizeof(struct agentrank_ns0_agent));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}id...\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}id of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }
        _agent->id = ((xmlChar*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0AgentType(_agent);
      free(_agent);
      return NULL;
    }
  }


  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0AgentType(_agent);
        free(_agent);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "sales", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}sales of type {}sales.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0SalesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}sales of type {}sales.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }

        _agent->sales = ((struct agentrank_ns0_sales*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "charts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}charts of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}charts of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }

        _agent->charts = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "profile", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}profile of type {}profile.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ProfileType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}profile of type {}profile.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }

        _agent->profile = ((struct agentrank_ns0_profile*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "reviews", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}reviews of type {}reviews.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ReviewsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}reviews of type {}reviews.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }

        _agent->reviews = ((struct agentrank_ns0_reviews*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecasts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecasts of type {}forecasts.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ForecastsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecasts of type {}forecasts.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0AgentType(_agent);
          free(_agent);
          return NULL;
        }

        _agent->forecasts = ((struct agentrank_ns0_forecasts*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}agent.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}agent. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _agent;
}

/**
 * Writes a Agent to XML.
 *
 * @param writer The XML writer.
 * @param _agent The Agent to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0AgentType(xmlTextWriterPtr writer, struct agentrank_ns0_agent *_agent) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_agent->id != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "id", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}id...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_agent->id));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_agent->sales != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sales", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}sales for element {}sales...\n");
#endif
    status = xmlTextWriterWriteNs0SalesType(writer, (_agent->sales));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}sales for element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_agent->charts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "charts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}charts...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_agent->charts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_agent->profile != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "profile", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}profile for element {}profile...\n");
#endif
    status = xmlTextWriterWriteNs0ProfileType(writer, (_agent->profile));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}profile for element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_agent->reviews != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "reviews", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}reviews for element {}reviews...\n");
#endif
    status = xmlTextWriterWriteNs0ReviewsType(writer, (_agent->reviews));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}reviews for element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_agent->forecasts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecasts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}forecasts for element {}forecasts...\n");
#endif
    status = xmlTextWriterWriteNs0ForecastsType(writer, (_agent->forecasts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}forecasts for element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Agent.
 *
 * @param _agent The Agent to free.
 */
static void freeNs0AgentType(struct agentrank_ns0_agent *_agent) {
  int i;
  if (_agent->id != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor id of type agentrank_ns0_agent...\n");
#endif
    freeXsStringType(_agent->id);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor id of type agentrank_ns0_agent...\n");
#endif
    free(_agent->id);
  }
  if (_agent->sales != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor sales of type agentrank_ns0_agent...\n");
#endif
    freeNs0SalesType(_agent->sales);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor sales of type agentrank_ns0_agent...\n");
#endif
    free(_agent->sales);
  }
  if (_agent->charts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor charts of type agentrank_ns0_agent...\n");
#endif
    freeNs0ImagesType(_agent->charts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor charts of type agentrank_ns0_agent...\n");
#endif
    free(_agent->charts);
  }
  if (_agent->profile != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor profile of type agentrank_ns0_agent...\n");
#endif
    freeNs0ProfileType(_agent->profile);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor profile of type agentrank_ns0_agent...\n");
#endif
    free(_agent->profile);
  }
  if (_agent->reviews != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor reviews of type agentrank_ns0_agent...\n");
#endif
    freeNs0ReviewsType(_agent->reviews);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor reviews of type agentrank_ns0_agent...\n");
#endif
    free(_agent->reviews);
  }
  if (_agent->forecasts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor forecasts of type agentrank_ns0_agent...\n");
#endif
    freeNs0ForecastsType(_agent->forecasts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecasts of type agentrank_ns0_agent...\n");
#endif
    free(_agent->forecasts);
  }
}
#endif /* DEF_agentrank_ns0_agent_M */
#ifndef DEF_agentrank_ns0_claimProfile_M
#define DEF_agentrank_ns0_claimProfile_M

/**
 * Reads a ClaimProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The ClaimProfile, or NULL in case of error.
 */
struct agentrank_ns0_claimProfile *xml_read_agentrank_ns0_claimProfile(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a ClaimProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_claimProfile(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _claimProfile, 1);
}

/**
 * Frees a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile to free.
 */
void free_agentrank_ns0_claimProfile(struct agentrank_ns0_claimProfile *_claimProfile) {
  freeNs0ClaimProfileType(_claimProfile);
  free(_claimProfile);
}

/**
 * Reads a ClaimProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The ClaimProfile, or NULL in case of error.
 */
struct agentrank_ns0_claimProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_claimProfile *_claimProfile = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _claimProfile = xmlTextReaderReadNs0ClaimProfileType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_claimProfile == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _claimProfile;
}

/**
 * Writes a ClaimProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _claimProfile, 0);
}

/**
 * Writes a ClaimProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}claimProfile for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0ClaimProfileType(writer, _claimProfile);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_claimProfile *_claimProfile) {
  freeNs0ClaimProfileType(_claimProfile);
}

/**
 * Reads a ClaimProfile from XML. The reader is assumed to be at the start element.
 *
 * @return the ClaimProfile, or NULL in case of error.
 */
static struct agentrank_ns0_claimProfile *xmlTextReaderReadNs0ClaimProfileType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_claimProfile *_claimProfile = calloc(1, sizeof(struct agentrank_ns0_claimProfile));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ClaimProfileType(_claimProfile);
        free(_claimProfile);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ClaimProfileType(_claimProfile);
          free(_claimProfile);
          return NULL;
        }

        _claimProfile->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}claimProfile.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}claimProfile. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _claimProfile;
}

/**
 * Writes a ClaimProfile to XML.
 *
 * @param writer The XML writer.
 * @param _claimProfile The ClaimProfile to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ClaimProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_claimProfile *_claimProfile) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_claimProfile->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_claimProfile->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a ClaimProfile.
 *
 * @param _claimProfile The ClaimProfile to free.
 */
static void freeNs0ClaimProfileType(struct agentrank_ns0_claimProfile *_claimProfile) {
  int i;
  if (_claimProfile->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_claimProfile...\n");
#endif
    freeNs0StatusType(_claimProfile->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_claimProfile...\n");
#endif
    free(_claimProfile->status);
  }
}
#endif /* DEF_agentrank_ns0_claimProfile_M */
#ifndef DEF_agentrank_ns0_findProfiles_M
#define DEF_agentrank_ns0_findProfiles_M

/**
 * Reads a FindProfiles element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The FindProfiles, or NULL in case of error.
 */
struct agentrank_ns0_findProfiles *xml_read_agentrank_ns0_findProfiles(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a FindProfiles to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_findProfiles(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _findProfiles, 1);
}

/**
 * Frees a FindProfiles.
 *
 * @param _findProfiles The FindProfiles to free.
 */
void free_agentrank_ns0_findProfiles(struct agentrank_ns0_findProfiles *_findProfiles) {
  freeNs0FindProfilesType(_findProfiles);
  free(_findProfiles);
}

/**
 * Reads a FindProfiles element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The FindProfiles, or NULL in case of error.
 */
struct agentrank_ns0_findProfiles *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_findProfiles *_findProfiles = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _findProfiles = xmlTextReaderReadNs0FindProfilesType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_findProfiles == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _findProfiles;
}

/**
 * Writes a FindProfiles to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _findProfiles, 0);
}

/**
 * Writes a FindProfiles to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}findProfiles for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0FindProfilesType(writer, _findProfiles);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a FindProfiles.
 *
 * @param _findProfiles The FindProfiles whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_findProfiles *_findProfiles) {
  freeNs0FindProfilesType(_findProfiles);
}

/**
 * Reads a FindProfiles from XML. The reader is assumed to be at the start element.
 *
 * @return the FindProfiles, or NULL in case of error.
 */
static struct agentrank_ns0_findProfiles *xmlTextReaderReadNs0FindProfilesType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_findProfiles *_findProfiles = calloc(1, sizeof(struct agentrank_ns0_findProfiles));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0FindProfilesType(_findProfiles);
        free(_findProfiles);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0FindProfilesType(_findProfiles);
          free(_findProfiles);
          return NULL;
        }

        _findProfiles->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "profiles", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}profiles of type {}profiles.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ProfilesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}profiles of type {}profiles.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0FindProfilesType(_findProfiles);
          free(_findProfiles);
          return NULL;
        }

        _findProfiles->profiles = ((struct agentrank_ns0_profiles*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}findProfiles.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}findProfiles. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _findProfiles;
}

/**
 * Writes a FindProfiles to XML.
 *
 * @param writer The XML writer.
 * @param _findProfiles The FindProfiles to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0FindProfilesType(xmlTextWriterPtr writer, struct agentrank_ns0_findProfiles *_findProfiles) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_findProfiles->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_findProfiles->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_findProfiles->profiles != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "profiles", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}profiles. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}profiles for element {}profiles...\n");
#endif
    status = xmlTextWriterWriteNs0ProfilesType(writer, (_findProfiles->profiles));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}profiles for element {}profiles. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}profiles. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a FindProfiles.
 *
 * @param _findProfiles The FindProfiles to free.
 */
static void freeNs0FindProfilesType(struct agentrank_ns0_findProfiles *_findProfiles) {
  int i;
  if (_findProfiles->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_findProfiles...\n");
#endif
    freeNs0StatusType(_findProfiles->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_findProfiles...\n");
#endif
    free(_findProfiles->status);
  }
  if (_findProfiles->profiles != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor profiles of type agentrank_ns0_findProfiles...\n");
#endif
    freeNs0ProfilesType(_findProfiles->profiles);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor profiles of type agentrank_ns0_findProfiles...\n");
#endif
    free(_findProfiles->profiles);
  }
}
#endif /* DEF_agentrank_ns0_findProfiles_M */
#ifndef DEF_agentrank_ns0_forecast_M
#define DEF_agentrank_ns0_forecast_M

/**
 * Reads a Forecast element from XML. The element to be read is "forecast", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Forecast, or NULL in case of error.
 */
struct agentrank_ns0_forecast *xml_read_agentrank_ns0_forecast(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ForecastElement(reader);
}

/**
 * Writes a Forecast to XML under element name "forecast".
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_forecast(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast) {
  return xmlTextWriterWriteNs0ForecastElementNS(writer, _forecast, 1);
}

/**
 * Frees a Forecast.
 *
 * @param _forecast The Forecast to free.
 */
void free_agentrank_ns0_forecast(struct agentrank_ns0_forecast *_forecast) {
  freeNs0ForecastType(_forecast);
  free(_forecast);
}

/**
 * Reads a Forecast element from XML. The element to be read is "forecast", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Forecast, or NULL in case of error.
 */
struct agentrank_ns0_forecast *xmlTextReaderReadNs0ForecastElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_forecast *_forecast = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "forecast", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}forecast.\n");
#endif
    _forecast = xmlTextReaderReadNs0ForecastType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_forecast == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}forecast failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}forecast failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _forecast;
}

/**
 * Writes a Forecast to XML under element name "forecast".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ForecastElement(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast) {
  return xmlTextWriterWriteNs0ForecastElementNS(writer, _forecast, 0);
}

/**
 * Writes a Forecast to XML under element name "forecast".
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ForecastElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecast", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}forecast. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}forecast for root element {}forecast...\n");
#endif
  status = xmlTextWriterWriteNs0ForecastType(writer, _forecast);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}forecast. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}forecast. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Forecast.
 *
 * @param _forecast The Forecast whose children are to be free.
 */
static void freeNs0ForecastElement(struct agentrank_ns0_forecast *_forecast) {
  freeNs0ForecastType(_forecast);
}

/**
 * Reads a Forecast from XML. The reader is assumed to be at the start element.
 *
 * @return the Forecast, or NULL in case of error.
 */
static struct agentrank_ns0_forecast *xmlTextReaderReadNs0ForecastType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_forecast *_forecast = calloc(1, sizeof(struct agentrank_ns0_forecast));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}id...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}id of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }
        _forecast->id = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "key", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}key...\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}key of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }
        _forecast->key = ((xmlChar*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0ForecastType(_forecast);
      free(_forecast);
      return NULL;
    }
  }


  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ForecastType(_forecast);
        free(_forecast);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "link", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}link of type {}link.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0LinkType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}link of type {}link.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->link = ((struct agentrank_ns0_link*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "date", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}date of type {http://www.w3.org/2001/XMLSchema}dateTime.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDateTimeType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}date of type {http://www.w3.org/2001/XMLSchema}dateTime.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->date = ((struct tm*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "slugs", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}slugs of type {}slugs.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0SlugsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}slugs of type {}slugs.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->slugs = ((struct agentrank_ns0_slugs*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "body", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}body of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}body of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->body = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "title", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->title = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "market", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}market of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}market of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->market = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "metric", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}metric of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}metric of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->metric = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "spot", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}spot of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDecimalType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}spot of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->spot = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "future", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}future of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDecimalType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}future of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastType(_forecast);
          free(_forecast);
          return NULL;
        }

        _forecast->future = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}forecast.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}forecast. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _forecast;
}

/**
 * Writes a Forecast to XML.
 *
 * @param writer The XML writer.
 * @param _forecast The Forecast to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ForecastType(xmlTextWriterPtr writer, struct agentrank_ns0_forecast *_forecast) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_forecast->id != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "id", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}id...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecast->id));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_forecast->key != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "key", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}key. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}key...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecast->key));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}key. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}key. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->link != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "link", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}link for element {}link...\n");
#endif
    status = xmlTextWriterWriteNs0LinkType(writer, (_forecast->link));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}link for element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->date != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "date", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}dateTime for element {}date...\n");
#endif
    status = xmlTextWriterWriteXsDateTimeType(writer, (_forecast->date));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}dateTime for element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}date. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->slugs != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "slugs", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}slugs for element {}slugs...\n");
#endif
    status = xmlTextWriterWriteNs0SlugsType(writer, (_forecast->slugs));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}slugs for element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->body != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "body", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}body. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}body...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecast->body));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}body. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}body. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->title != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "title", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}title...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecast->title));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->market != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "market", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}market...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecast->market));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}market. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->metric != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "metric", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}metric...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecast->metric));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}metric. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->spot != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "spot", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}spot. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}spot...\n");
#endif
    status = xmlTextWriterWriteXsDecimalType(writer, (_forecast->spot));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}spot. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}spot. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecast->future != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "future", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}future. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}future...\n");
#endif
    status = xmlTextWriterWriteXsDecimalType(writer, (_forecast->future));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}future. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}future. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Forecast.
 *
 * @param _forecast The Forecast to free.
 */
static void freeNs0ForecastType(struct agentrank_ns0_forecast *_forecast) {
  int i;
  if (_forecast->id != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor id of type agentrank_ns0_forecast...\n");
#endif
    freeXsIntType(_forecast->id);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor id of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->id);
  }
  if (_forecast->key != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor key of type agentrank_ns0_forecast...\n");
#endif
    freeXsStringType(_forecast->key);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor key of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->key);
  }
  if (_forecast->link != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor link of type agentrank_ns0_forecast...\n");
#endif
    freeNs0LinkType(_forecast->link);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor link of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->link);
  }
  if (_forecast->date != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor date of type agentrank_ns0_forecast...\n");
#endif
    freeXsDateTimeType(_forecast->date);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor date of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->date);
  }
  if (_forecast->slugs != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor slugs of type agentrank_ns0_forecast...\n");
#endif
    freeNs0SlugsType(_forecast->slugs);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor slugs of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->slugs);
  }
  if (_forecast->body != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor body of type agentrank_ns0_forecast...\n");
#endif
    freeXsStringType(_forecast->body);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor body of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->body);
  }
  if (_forecast->title != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor title of type agentrank_ns0_forecast...\n");
#endif
    freeXsStringType(_forecast->title);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor title of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->title);
  }
  if (_forecast->market != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor market of type agentrank_ns0_forecast...\n");
#endif
    freeXsStringType(_forecast->market);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor market of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->market);
  }
  if (_forecast->metric != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor metric of type agentrank_ns0_forecast...\n");
#endif
    freeXsStringType(_forecast->metric);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor metric of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->metric);
  }
  if (_forecast->spot != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor spot of type agentrank_ns0_forecast...\n");
#endif
    freeXsDecimalType(_forecast->spot);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor spot of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->spot);
  }
  if (_forecast->future != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor future of type agentrank_ns0_forecast...\n");
#endif
    freeXsDecimalType(_forecast->future);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor future of type agentrank_ns0_forecast...\n");
#endif
    free(_forecast->future);
  }
}
#endif /* DEF_agentrank_ns0_forecast_M */
#ifndef DEF_agentrank_ns0_forecasts_M
#define DEF_agentrank_ns0_forecasts_M

/**
 * Reads a Forecasts element from XML. The element to be read is "forecasts", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Forecasts, or NULL in case of error.
 */
struct agentrank_ns0_forecasts *xml_read_agentrank_ns0_forecasts(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ForecastsElement(reader);
}

/**
 * Writes a Forecasts to XML under element name "forecasts".
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_forecasts(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts) {
  return xmlTextWriterWriteNs0ForecastsElementNS(writer, _forecasts, 1);
}

/**
 * Frees a Forecasts.
 *
 * @param _forecasts The Forecasts to free.
 */
void free_agentrank_ns0_forecasts(struct agentrank_ns0_forecasts *_forecasts) {
  freeNs0ForecastsType(_forecasts);
  free(_forecasts);
}

/**
 * Reads a Forecasts element from XML. The element to be read is "forecasts", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Forecasts, or NULL in case of error.
 */
struct agentrank_ns0_forecasts *xmlTextReaderReadNs0ForecastsElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_forecasts *_forecasts = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "forecasts", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}forecasts.\n");
#endif
    _forecasts = xmlTextReaderReadNs0ForecastsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_forecasts == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}forecasts failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}forecasts failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _forecasts;
}

/**
 * Writes a Forecasts to XML under element name "forecasts".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ForecastsElement(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts) {
  return xmlTextWriterWriteNs0ForecastsElementNS(writer, _forecasts, 0);
}

/**
 * Writes a Forecasts to XML under element name "forecasts".
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ForecastsElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecasts", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}forecasts. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}forecasts for root element {}forecasts...\n");
#endif
  status = xmlTextWriterWriteNs0ForecastsType(writer, _forecasts);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}forecasts. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}forecasts. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Forecasts.
 *
 * @param _forecasts The Forecasts whose children are to be free.
 */
static void freeNs0ForecastsElement(struct agentrank_ns0_forecasts *_forecasts) {
  freeNs0ForecastsType(_forecasts);
}

/**
 * Reads a Forecasts from XML. The reader is assumed to be at the start element.
 *
 * @return the Forecasts, or NULL in case of error.
 */
static struct agentrank_ns0_forecasts *xmlTextReaderReadNs0ForecastsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_forecasts *_forecasts = calloc(1, sizeof(struct agentrank_ns0_forecasts));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "start_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}start_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}start_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }
        _forecasts->start_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "max_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}max_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}max_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }
        _forecasts->max_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "last_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}last_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}last_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }
        _forecasts->last_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "total_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}total_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}total_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }
        _forecasts->total_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "first_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}first_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}first_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }
        _forecasts->first_index = ((int*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0ForecastsType(_forecasts);
      free(_forecasts);
      return NULL;
    }
  }


  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ForecastsType(_forecasts);
        free(_forecasts);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "title", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }

        _forecasts->title = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecast", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecast of type {}forecast.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ForecastType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecast of type {}forecast.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ForecastsType(_forecasts);
          free(_forecasts);
          return NULL;
        }

        _forecasts->forecast = realloc(_forecasts->forecast, (_forecasts->_sizeof_forecast + 1) * sizeof(struct agentrank_ns0_forecast));
        memcpy(&(_forecasts->forecast[_forecasts->_sizeof_forecast++]), _child_accessor, sizeof(struct agentrank_ns0_forecast));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}forecasts.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}forecasts. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _forecasts;
}

/**
 * Writes a Forecasts to XML.
 *
 * @param writer The XML writer.
 * @param _forecasts The Forecasts to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ForecastsType(xmlTextWriterPtr writer, struct agentrank_ns0_forecasts *_forecasts) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_forecasts->start_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "start_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}start_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecasts->start_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_forecasts->max_results != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "max_results", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}max_results. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}max_results...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecasts->max_results));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}max_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}max_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_forecasts->last_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "last_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}last_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}last_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecasts->last_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}last_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}last_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_forecasts->total_results != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "total_results", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}total_results. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}total_results...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecasts->total_results));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}total_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}total_results. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_forecasts->first_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "first_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}first_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}first_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_forecasts->first_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}first_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}first_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_forecasts->title != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "title", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}title...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_forecasts->title));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  for (i = 0; i < _forecasts->_sizeof_forecast; i++) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecast", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}forecast for element {}forecast...\n");
#endif
    status = xmlTextWriterWriteNs0ForecastType(writer, &(_forecasts->forecast[i]));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}forecast for element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Forecasts.
 *
 * @param _forecasts The Forecasts to free.
 */
static void freeNs0ForecastsType(struct agentrank_ns0_forecasts *_forecasts) {
  int i;
  if (_forecasts->start_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor start_index of type agentrank_ns0_forecasts...\n");
#endif
    freeXsIntType(_forecasts->start_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor start_index of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->start_index);
  }
  if (_forecasts->max_results != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor max_results of type agentrank_ns0_forecasts...\n");
#endif
    freeXsIntType(_forecasts->max_results);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor max_results of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->max_results);
  }
  if (_forecasts->last_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor last_index of type agentrank_ns0_forecasts...\n");
#endif
    freeXsIntType(_forecasts->last_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor last_index of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->last_index);
  }
  if (_forecasts->total_results != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor total_results of type agentrank_ns0_forecasts...\n");
#endif
    freeXsIntType(_forecasts->total_results);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor total_results of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->total_results);
  }
  if (_forecasts->first_index != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor first_index of type agentrank_ns0_forecasts...\n");
#endif
    freeXsIntType(_forecasts->first_index);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor first_index of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->first_index);
  }
  if (_forecasts->title != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor title of type agentrank_ns0_forecasts...\n");
#endif
    freeXsStringType(_forecasts->title);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor title of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->title);
  }
  if (_forecasts->forecast != NULL) {
    for (i = 0; i < _forecasts->_sizeof_forecast; i++) {
#if DEBUG_ENUNCIATE > 1
      printf("Freeing accessor forecast[%i] of type agentrank_ns0_forecasts...\n", i);
#endif
      freeNs0ForecastType(&(_forecasts->forecast[i]));
    }
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecast of type agentrank_ns0_forecasts...\n");
#endif
    free(_forecasts->forecast);
  }
}
#endif /* DEF_agentrank_ns0_forecasts_M */
#ifndef DEF_agentrank_ns0_getForecast_M
#define DEF_agentrank_ns0_getForecast_M

/**
 * Reads a GetForecast element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetForecast, or NULL in case of error.
 */
struct agentrank_ns0_getForecast *xml_read_agentrank_ns0_getForecast(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetForecast to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getForecast(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getForecast, 1);
}

/**
 * Frees a GetForecast.
 *
 * @param _getForecast The GetForecast to free.
 */
void free_agentrank_ns0_getForecast(struct agentrank_ns0_getForecast *_getForecast) {
  freeNs0GetForecastType(_getForecast);
  free(_getForecast);
}

/**
 * Reads a GetForecast element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetForecast, or NULL in case of error.
 */
struct agentrank_ns0_getForecast *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getForecast *_getForecast = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getForecast = xmlTextReaderReadNs0GetForecastType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getForecast == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getForecast;
}

/**
 * Writes a GetForecast to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getForecast, 0);
}

/**
 * Writes a GetForecast to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getForecast for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetForecastType(writer, _getForecast);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetForecast.
 *
 * @param _getForecast The GetForecast whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getForecast *_getForecast) {
  freeNs0GetForecastType(_getForecast);
}

/**
 * Reads a GetForecast from XML. The reader is assumed to be at the start element.
 *
 * @return the GetForecast, or NULL in case of error.
 */
static struct agentrank_ns0_getForecast *xmlTextReaderReadNs0GetForecastType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getForecast *_getForecast = calloc(1, sizeof(struct agentrank_ns0_getForecast));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetForecastType(_getForecast);
        free(_getForecast);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "charts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}charts of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}charts of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastType(_getForecast);
          free(_getForecast);
          return NULL;
        }

        _getForecast->charts = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecast", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecast of type {}forecast.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ForecastType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecast of type {}forecast.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastType(_getForecast);
          free(_getForecast);
          return NULL;
        }

        _getForecast->forecast = ((struct agentrank_ns0_forecast*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastType(_getForecast);
          free(_getForecast);
          return NULL;
        }

        _getForecast->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getForecast.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getForecast. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getForecast;
}

/**
 * Writes a GetForecast to XML.
 *
 * @param writer The XML writer.
 * @param _getForecast The GetForecast to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetForecastType(xmlTextWriterPtr writer, struct agentrank_ns0_getForecast *_getForecast) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getForecast->charts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "charts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}charts...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getForecast->charts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getForecast->forecast != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecast", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}forecast for element {}forecast...\n");
#endif
    status = xmlTextWriterWriteNs0ForecastType(writer, (_getForecast->forecast));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}forecast for element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecast. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getForecast->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getForecast->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetForecast.
 *
 * @param _getForecast The GetForecast to free.
 */
static void freeNs0GetForecastType(struct agentrank_ns0_getForecast *_getForecast) {
  int i;
  if (_getForecast->charts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor charts of type agentrank_ns0_getForecast...\n");
#endif
    freeNs0ImagesType(_getForecast->charts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor charts of type agentrank_ns0_getForecast...\n");
#endif
    free(_getForecast->charts);
  }
  if (_getForecast->forecast != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor forecast of type agentrank_ns0_getForecast...\n");
#endif
    freeNs0ForecastType(_getForecast->forecast);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecast of type agentrank_ns0_getForecast...\n");
#endif
    free(_getForecast->forecast);
  }
  if (_getForecast->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getForecast...\n");
#endif
    freeNs0StatusType(_getForecast->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getForecast...\n");
#endif
    free(_getForecast->status);
  }
}
#endif /* DEF_agentrank_ns0_getForecast_M */
#ifndef DEF_agentrank_ns0_getForecasts_M
#define DEF_agentrank_ns0_getForecasts_M

/**
 * Reads a GetForecasts element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetForecasts, or NULL in case of error.
 */
struct agentrank_ns0_getForecasts *xml_read_agentrank_ns0_getForecasts(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetForecasts to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getForecasts(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getForecasts, 1);
}

/**
 * Frees a GetForecasts.
 *
 * @param _getForecasts The GetForecasts to free.
 */
void free_agentrank_ns0_getForecasts(struct agentrank_ns0_getForecasts *_getForecasts) {
  freeNs0GetForecastsType(_getForecasts);
  free(_getForecasts);
}

/**
 * Reads a GetForecasts element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetForecasts, or NULL in case of error.
 */
struct agentrank_ns0_getForecasts *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getForecasts *_getForecasts = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getForecasts = xmlTextReaderReadNs0GetForecastsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getForecasts == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getForecasts;
}

/**
 * Writes a GetForecasts to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getForecasts, 0);
}

/**
 * Writes a GetForecasts to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getForecasts for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetForecastsType(writer, _getForecasts);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetForecasts.
 *
 * @param _getForecasts The GetForecasts whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getForecasts *_getForecasts) {
  freeNs0GetForecastsType(_getForecasts);
}

/**
 * Reads a GetForecasts from XML. The reader is assumed to be at the start element.
 *
 * @return the GetForecasts, or NULL in case of error.
 */
static struct agentrank_ns0_getForecasts *xmlTextReaderReadNs0GetForecastsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getForecasts *_getForecasts = calloc(1, sizeof(struct agentrank_ns0_getForecasts));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetForecastsType(_getForecasts);
        free(_getForecasts);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "charts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}charts of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}charts of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastsType(_getForecasts);
          free(_getForecasts);
          return NULL;
        }

        _getForecasts->charts = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastsType(_getForecasts);
          free(_getForecasts);
          return NULL;
        }

        _getForecasts->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecasts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecasts of type {}forecasts.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ForecastsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecasts of type {}forecasts.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetForecastsType(_getForecasts);
          free(_getForecasts);
          return NULL;
        }

        _getForecasts->forecasts = ((struct agentrank_ns0_forecasts*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getForecasts.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getForecasts. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getForecasts;
}

/**
 * Writes a GetForecasts to XML.
 *
 * @param writer The XML writer.
 * @param _getForecasts The GetForecasts to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetForecastsType(xmlTextWriterPtr writer, struct agentrank_ns0_getForecasts *_getForecasts) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getForecasts->charts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "charts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}charts...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getForecasts->charts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getForecasts->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getForecasts->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getForecasts->forecasts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecasts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}forecasts for element {}forecasts...\n");
#endif
    status = xmlTextWriterWriteNs0ForecastsType(writer, (_getForecasts->forecasts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}forecasts for element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetForecasts.
 *
 * @param _getForecasts The GetForecasts to free.
 */
static void freeNs0GetForecastsType(struct agentrank_ns0_getForecasts *_getForecasts) {
  int i;
  if (_getForecasts->charts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor charts of type agentrank_ns0_getForecasts...\n");
#endif
    freeNs0ImagesType(_getForecasts->charts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor charts of type agentrank_ns0_getForecasts...\n");
#endif
    free(_getForecasts->charts);
  }
  if (_getForecasts->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getForecasts...\n");
#endif
    freeNs0StatusType(_getForecasts->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getForecasts...\n");
#endif
    free(_getForecasts->status);
  }
  if (_getForecasts->forecasts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor forecasts of type agentrank_ns0_getForecasts...\n");
#endif
    freeNs0ForecastsType(_getForecasts->forecasts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecasts of type agentrank_ns0_getForecasts...\n");
#endif
    free(_getForecasts->forecasts);
  }
}
#endif /* DEF_agentrank_ns0_getForecasts_M */
#ifndef DEF_agentrank_ns0_getProfile_M
#define DEF_agentrank_ns0_getProfile_M

/**
 * Reads a GetProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetProfile, or NULL in case of error.
 */
struct agentrank_ns0_getProfile *xml_read_agentrank_ns0_getProfile(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getProfile(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getProfile, 1);
}

/**
 * Frees a GetProfile.
 *
 * @param _getProfile The GetProfile to free.
 */
void free_agentrank_ns0_getProfile(struct agentrank_ns0_getProfile *_getProfile) {
  freeNs0GetProfileType(_getProfile);
  free(_getProfile);
}

/**
 * Reads a GetProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetProfile, or NULL in case of error.
 */
struct agentrank_ns0_getProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getProfile *_getProfile = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getProfile = xmlTextReaderReadNs0GetProfileType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getProfile == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getProfile;
}

/**
 * Writes a GetProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getProfile, 0);
}

/**
 * Writes a GetProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getProfile for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetProfileType(writer, _getProfile);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetProfile.
 *
 * @param _getProfile The GetProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getProfile *_getProfile) {
  freeNs0GetProfileType(_getProfile);
}

/**
 * Reads a GetProfile from XML. The reader is assumed to be at the start element.
 *
 * @return the GetProfile, or NULL in case of error.
 */
static struct agentrank_ns0_getProfile *xmlTextReaderReadNs0GetProfileType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getProfile *_getProfile = calloc(1, sizeof(struct agentrank_ns0_getProfile));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetProfileType(_getProfile);
        free(_getProfile);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetProfileType(_getProfile);
          free(_getProfile);
          return NULL;
        }

        _getProfile->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "profile", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}profile of type {}profile.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ProfileType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}profile of type {}profile.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetProfileType(_getProfile);
          free(_getProfile);
          return NULL;
        }

        _getProfile->profile = ((struct agentrank_ns0_profile*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getProfile.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getProfile. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getProfile;
}

/**
 * Writes a GetProfile to XML.
 *
 * @param writer The XML writer.
 * @param _getProfile The GetProfile to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_getProfile *_getProfile) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getProfile->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getProfile->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getProfile->profile != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "profile", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}profile for element {}profile...\n");
#endif
    status = xmlTextWriterWriteNs0ProfileType(writer, (_getProfile->profile));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}profile for element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}profile. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetProfile.
 *
 * @param _getProfile The GetProfile to free.
 */
static void freeNs0GetProfileType(struct agentrank_ns0_getProfile *_getProfile) {
  int i;
  if (_getProfile->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getProfile...\n");
#endif
    freeNs0StatusType(_getProfile->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getProfile...\n");
#endif
    free(_getProfile->status);
  }
  if (_getProfile->profile != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor profile of type agentrank_ns0_getProfile...\n");
#endif
    freeNs0ProfileType(_getProfile->profile);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor profile of type agentrank_ns0_getProfile...\n");
#endif
    free(_getProfile->profile);
  }
}
#endif /* DEF_agentrank_ns0_getProfile_M */
#ifndef DEF_agentrank_ns0_getReview_M
#define DEF_agentrank_ns0_getReview_M

/**
 * Reads a GetReview element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetReview, or NULL in case of error.
 */
struct agentrank_ns0_getReview *xml_read_agentrank_ns0_getReview(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetReview to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getReview(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getReview, 1);
}

/**
 * Frees a GetReview.
 *
 * @param _getReview The GetReview to free.
 */
void free_agentrank_ns0_getReview(struct agentrank_ns0_getReview *_getReview) {
  freeNs0GetReviewType(_getReview);
  free(_getReview);
}

/**
 * Reads a GetReview element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetReview, or NULL in case of error.
 */
struct agentrank_ns0_getReview *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getReview *_getReview = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getReview = xmlTextReaderReadNs0GetReviewType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getReview == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getReview;
}

/**
 * Writes a GetReview to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getReview, 0);
}

/**
 * Writes a GetReview to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getReview for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetReviewType(writer, _getReview);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetReview.
 *
 * @param _getReview The GetReview whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getReview *_getReview) {
  freeNs0GetReviewType(_getReview);
}

/**
 * Reads a GetReview from XML. The reader is assumed to be at the start element.
 *
 * @return the GetReview, or NULL in case of error.
 */
static struct agentrank_ns0_getReview *xmlTextReaderReadNs0GetReviewType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getReview *_getReview = calloc(1, sizeof(struct agentrank_ns0_getReview));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetReviewType(_getReview);
        free(_getReview);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetReviewType(_getReview);
          free(_getReview);
          return NULL;
        }

        _getReview->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "review", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}review of type {}review.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ReviewType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}review of type {}review.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetReviewType(_getReview);
          free(_getReview);
          return NULL;
        }

        _getReview->review = ((struct agentrank_ns0_review*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getReview.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getReview. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getReview;
}

/**
 * Writes a GetReview to XML.
 *
 * @param writer The XML writer.
 * @param _getReview The GetReview to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetReviewType(xmlTextWriterPtr writer, struct agentrank_ns0_getReview *_getReview) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getReview->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getReview->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getReview->review != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "review", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}review. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}review for element {}review...\n");
#endif
    status = xmlTextWriterWriteNs0ReviewType(writer, (_getReview->review));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}review for element {}review. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}review. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetReview.
 *
 * @param _getReview The GetReview to free.
 */
static void freeNs0GetReviewType(struct agentrank_ns0_getReview *_getReview) {
  int i;
  if (_getReview->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getReview...\n");
#endif
    freeNs0StatusType(_getReview->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getReview...\n");
#endif
    free(_getReview->status);
  }
  if (_getReview->review != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor review of type agentrank_ns0_getReview...\n");
#endif
    freeNs0ReviewType(_getReview->review);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor review of type agentrank_ns0_getReview...\n");
#endif
    free(_getReview->review);
  }
}
#endif /* DEF_agentrank_ns0_getReview_M */
#ifndef DEF_agentrank_ns0_getReviews_M
#define DEF_agentrank_ns0_getReviews_M

/**
 * Reads a GetReviews element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetReviews, or NULL in case of error.
 */
struct agentrank_ns0_getReviews *xml_read_agentrank_ns0_getReviews(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetReviews to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getReviews(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getReviews, 1);
}

/**
 * Frees a GetReviews.
 *
 * @param _getReviews The GetReviews to free.
 */
void free_agentrank_ns0_getReviews(struct agentrank_ns0_getReviews *_getReviews) {
  freeNs0GetReviewsType(_getReviews);
  free(_getReviews);
}

/**
 * Reads a GetReviews element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetReviews, or NULL in case of error.
 */
struct agentrank_ns0_getReviews *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getReviews *_getReviews = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getReviews = xmlTextReaderReadNs0GetReviewsType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getReviews == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getReviews;
}

/**
 * Writes a GetReviews to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getReviews, 0);
}

/**
 * Writes a GetReviews to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getReviews for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetReviewsType(writer, _getReviews);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetReviews.
 *
 * @param _getReviews The GetReviews whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getReviews *_getReviews) {
  freeNs0GetReviewsType(_getReviews);
}

/**
 * Reads a GetReviews from XML. The reader is assumed to be at the start element.
 *
 * @return the GetReviews, or NULL in case of error.
 */
static struct agentrank_ns0_getReviews *xmlTextReaderReadNs0GetReviewsType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getReviews *_getReviews = calloc(1, sizeof(struct agentrank_ns0_getReviews));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetReviewsType(_getReviews);
        free(_getReviews);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetReviewsType(_getReviews);
          free(_getReviews);
          return NULL;
        }

        _getReviews->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "charts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}charts of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}charts of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetReviewsType(_getReviews);
          free(_getReviews);
          return NULL;
        }

        _getReviews->charts = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "reviews", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}reviews of type {}reviews.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ReviewsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}reviews of type {}reviews.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetReviewsType(_getReviews);
          free(_getReviews);
          return NULL;
        }

        _getReviews->reviews = ((struct agentrank_ns0_reviews*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getReviews.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getReviews. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getReviews;
}

/**
 * Writes a GetReviews to XML.
 *
 * @param writer The XML writer.
 * @param _getReviews The GetReviews to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetReviewsType(xmlTextWriterPtr writer, struct agentrank_ns0_getReviews *_getReviews) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getReviews->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getReviews->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getReviews->charts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "charts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}charts...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getReviews->charts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getReviews->reviews != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "reviews", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}reviews for element {}reviews...\n");
#endif
    status = xmlTextWriterWriteNs0ReviewsType(writer, (_getReviews->reviews));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}reviews for element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetReviews.
 *
 * @param _getReviews The GetReviews to free.
 */
static void freeNs0GetReviewsType(struct agentrank_ns0_getReviews *_getReviews) {
  int i;
  if (_getReviews->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getReviews...\n");
#endif
    freeNs0StatusType(_getReviews->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getReviews...\n");
#endif
    free(_getReviews->status);
  }
  if (_getReviews->charts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor charts of type agentrank_ns0_getReviews...\n");
#endif
    freeNs0ImagesType(_getReviews->charts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor charts of type agentrank_ns0_getReviews...\n");
#endif
    free(_getReviews->charts);
  }
  if (_getReviews->reviews != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor reviews of type agentrank_ns0_getReviews...\n");
#endif
    freeNs0ReviewsType(_getReviews->reviews);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor reviews of type agentrank_ns0_getReviews...\n");
#endif
    free(_getReviews->reviews);
  }
}
#endif /* DEF_agentrank_ns0_getReviews_M */
#ifndef DEF_agentrank_ns0_getSale_M
#define DEF_agentrank_ns0_getSale_M

/**
 * Reads a GetSale element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetSale, or NULL in case of error.
 */
struct agentrank_ns0_getSale *xml_read_agentrank_ns0_getSale(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetSale to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getSale(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getSale, 1);
}

/**
 * Frees a GetSale.
 *
 * @param _getSale The GetSale to free.
 */
void free_agentrank_ns0_getSale(struct agentrank_ns0_getSale *_getSale) {
  freeNs0GetSaleType(_getSale);
  free(_getSale);
}

/**
 * Reads a GetSale element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetSale, or NULL in case of error.
 */
struct agentrank_ns0_getSale *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getSale *_getSale = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getSale = xmlTextReaderReadNs0GetSaleType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getSale == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getSale;
}

/**
 * Writes a GetSale to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getSale, 0);
}

/**
 * Writes a GetSale to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getSale for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetSaleType(writer, _getSale);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetSale.
 *
 * @param _getSale The GetSale whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getSale *_getSale) {
  freeNs0GetSaleType(_getSale);
}

/**
 * Reads a GetSale from XML. The reader is assumed to be at the start element.
 *
 * @return the GetSale, or NULL in case of error.
 */
static struct agentrank_ns0_getSale *xmlTextReaderReadNs0GetSaleType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getSale *_getSale = calloc(1, sizeof(struct agentrank_ns0_getSale));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetSaleType(_getSale);
        free(_getSale);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "sale", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}sale of type {}sale.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0SaleType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}sale of type {}sale.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSaleType(_getSale);
          free(_getSale);
          return NULL;
        }

        _getSale->sale = ((struct agentrank_ns0_sale*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "maps", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}maps of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}maps of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSaleType(_getSale);
          free(_getSale);
          return NULL;
        }

        _getSale->maps = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSaleType(_getSale);
          free(_getSale);
          return NULL;
        }

        _getSale->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getSale.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getSale. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getSale;
}

/**
 * Writes a GetSale to XML.
 *
 * @param writer The XML writer.
 * @param _getSale The GetSale to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetSaleType(xmlTextWriterPtr writer, struct agentrank_ns0_getSale *_getSale) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getSale->sale != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sale", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}sale. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}sale for element {}sale...\n");
#endif
    status = xmlTextWriterWriteNs0SaleType(writer, (_getSale->sale));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}sale for element {}sale. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}sale. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getSale->maps != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "maps", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}maps...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getSale->maps));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getSale->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getSale->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetSale.
 *
 * @param _getSale The GetSale to free.
 */
static void freeNs0GetSaleType(struct agentrank_ns0_getSale *_getSale) {
  int i;
  if (_getSale->sale != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor sale of type agentrank_ns0_getSale...\n");
#endif
    freeNs0SaleType(_getSale->sale);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor sale of type agentrank_ns0_getSale...\n");
#endif
    free(_getSale->sale);
  }
  if (_getSale->maps != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor maps of type agentrank_ns0_getSale...\n");
#endif
    freeNs0ImagesType(_getSale->maps);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor maps of type agentrank_ns0_getSale...\n");
#endif
    free(_getSale->maps);
  }
  if (_getSale->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getSale...\n");
#endif
    freeNs0StatusType(_getSale->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getSale...\n");
#endif
    free(_getSale->status);
  }
}
#endif /* DEF_agentrank_ns0_getSale_M */
#ifndef DEF_agentrank_ns0_getSales_M
#define DEF_agentrank_ns0_getSales_M

/**
 * Reads a GetSales element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The GetSales, or NULL in case of error.
 */
struct agentrank_ns0_getSales *xml_read_agentrank_ns0_getSales(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a GetSales to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_getSales(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getSales, 1);
}

/**
 * Frees a GetSales.
 *
 * @param _getSales The GetSales to free.
 */
void free_agentrank_ns0_getSales(struct agentrank_ns0_getSales *_getSales) {
  freeNs0GetSalesType(_getSales);
  free(_getSales);
}

/**
 * Reads a GetSales element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The GetSales, or NULL in case of error.
 */
struct agentrank_ns0_getSales *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_getSales *_getSales = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _getSales = xmlTextReaderReadNs0GetSalesType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_getSales == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _getSales;
}

/**
 * Writes a GetSales to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _getSales, 0);
}

/**
 * Writes a GetSales to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}getSales for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0GetSalesType(writer, _getSales);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a GetSales.
 *
 * @param _getSales The GetSales whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_getSales *_getSales) {
  freeNs0GetSalesType(_getSales);
}

/**
 * Reads a GetSales from XML. The reader is assumed to be at the start element.
 *
 * @return the GetSales, or NULL in case of error.
 */
static struct agentrank_ns0_getSales *xmlTextReaderReadNs0GetSalesType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_getSales *_getSales = calloc(1, sizeof(struct agentrank_ns0_getSales));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0GetSalesType(_getSales);
        free(_getSales);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "sales", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}sales of type {}sales.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0SalesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}sales of type {}sales.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSalesType(_getSales);
          free(_getSales);
          return NULL;
        }

        _getSales->sales = ((struct agentrank_ns0_sales*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "maps", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}maps of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}maps of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSalesType(_getSales);
          free(_getSales);
          return NULL;
        }

        _getSales->maps = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "charts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}charts of type {}images.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImagesType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}charts of type {}images.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSalesType(_getSales);
          free(_getSales);
          return NULL;
        }

        _getSales->charts = ((struct agentrank_ns0_images*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0GetSalesType(_getSales);
          free(_getSales);
          return NULL;
        }

        _getSales->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}getSales.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}getSales. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _getSales;
}

/**
 * Writes a GetSales to XML.
 *
 * @param writer The XML writer.
 * @param _getSales The GetSales to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0GetSalesType(xmlTextWriterPtr writer, struct agentrank_ns0_getSales *_getSales) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_getSales->sales != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sales", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}sales for element {}sales...\n");
#endif
    status = xmlTextWriterWriteNs0SalesType(writer, (_getSales->sales));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}sales for element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getSales->maps != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "maps", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}maps...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getSales->maps));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}maps. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getSales->charts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "charts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}images for element {}charts...\n");
#endif
    status = xmlTextWriterWriteNs0ImagesType(writer, (_getSales->charts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}images for element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}charts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_getSales->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_getSales->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a GetSales.
 *
 * @param _getSales The GetSales to free.
 */
static void freeNs0GetSalesType(struct agentrank_ns0_getSales *_getSales) {
  int i;
  if (_getSales->sales != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor sales of type agentrank_ns0_getSales...\n");
#endif
    freeNs0SalesType(_getSales->sales);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor sales of type agentrank_ns0_getSales...\n");
#endif
    free(_getSales->sales);
  }
  if (_getSales->maps != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor maps of type agentrank_ns0_getSales...\n");
#endif
    freeNs0ImagesType(_getSales->maps);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor maps of type agentrank_ns0_getSales...\n");
#endif
    free(_getSales->maps);
  }
  if (_getSales->charts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor charts of type agentrank_ns0_getSales...\n");
#endif
    freeNs0ImagesType(_getSales->charts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor charts of type agentrank_ns0_getSales...\n");
#endif
    free(_getSales->charts);
  }
  if (_getSales->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_getSales...\n");
#endif
    freeNs0StatusType(_getSales->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_getSales...\n");
#endif
    free(_getSales->status);
  }
}
#endif /* DEF_agentrank_ns0_getSales_M */
#ifndef DEF_agentrank_ns0_pokeProfile_M
#define DEF_agentrank_ns0_pokeProfile_M

/**
 * Reads a PokeProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PokeProfile, or NULL in case of error.
 */
struct agentrank_ns0_pokeProfile *xml_read_agentrank_ns0_pokeProfile(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a PokeProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_pokeProfile(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _pokeProfile, 1);
}

/**
 * Frees a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile to free.
 */
void free_agentrank_ns0_pokeProfile(struct agentrank_ns0_pokeProfile *_pokeProfile) {
  freeNs0PokeProfileType(_pokeProfile);
  free(_pokeProfile);
}

/**
 * Reads a PokeProfile element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The PokeProfile, or NULL in case of error.
 */
struct agentrank_ns0_pokeProfile *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_pokeProfile *_pokeProfile = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _pokeProfile = xmlTextReaderReadNs0PokeProfileType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_pokeProfile == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _pokeProfile;
}

/**
 * Writes a PokeProfile to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _pokeProfile, 0);
}

/**
 * Writes a PokeProfile to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}pokeProfile for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0PokeProfileType(writer, _pokeProfile);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_pokeProfile *_pokeProfile) {
  freeNs0PokeProfileType(_pokeProfile);
}

/**
 * Reads a PokeProfile from XML. The reader is assumed to be at the start element.
 *
 * @return the PokeProfile, or NULL in case of error.
 */
static struct agentrank_ns0_pokeProfile *xmlTextReaderReadNs0PokeProfileType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_pokeProfile *_pokeProfile = calloc(1, sizeof(struct agentrank_ns0_pokeProfile));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0PokeProfileType(_pokeProfile);
        free(_pokeProfile);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0PokeProfileType(_pokeProfile);
          free(_pokeProfile);
          return NULL;
        }

        _pokeProfile->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}pokeProfile.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}pokeProfile. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _pokeProfile;
}

/**
 * Writes a PokeProfile to XML.
 *
 * @param writer The XML writer.
 * @param _pokeProfile The PokeProfile to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0PokeProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_pokeProfile *_pokeProfile) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_pokeProfile->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_pokeProfile->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a PokeProfile.
 *
 * @param _pokeProfile The PokeProfile to free.
 */
static void freeNs0PokeProfileType(struct agentrank_ns0_pokeProfile *_pokeProfile) {
  int i;
  if (_pokeProfile->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_pokeProfile...\n");
#endif
    freeNs0StatusType(_pokeProfile->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_pokeProfile...\n");
#endif
    free(_pokeProfile->status);
  }
}
#endif /* DEF_agentrank_ns0_pokeProfile_M */
#ifndef DEF_agentrank_ns0_postFlag_M
#define DEF_agentrank_ns0_postFlag_M

/**
 * Reads a PostFlag element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The PostFlag, or NULL in case of error.
 */
struct agentrank_ns0_postFlag *xml_read_agentrank_ns0_postFlag(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ResponseElement(reader);
}

/**
 * Writes a PostFlag to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_postFlag(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _postFlag, 1);
}

/**
 * Frees a PostFlag.
 *
 * @param _postFlag The PostFlag to free.
 */
void free_agentrank_ns0_postFlag(struct agentrank_ns0_postFlag *_postFlag) {
  freeNs0PostFlagType(_postFlag);
  free(_postFlag);
}

/**
 * Reads a PostFlag element from XML. The element to be read is "response", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The PostFlag, or NULL in case of error.
 */
struct agentrank_ns0_postFlag *xmlTextReaderReadNs0ResponseElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_postFlag *_postFlag = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "response", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}response.\n");
#endif
    _postFlag = xmlTextReaderReadNs0PostFlagType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_postFlag == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}response failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}response failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _postFlag;
}

/**
 * Writes a PostFlag to XML under element name "response".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElement(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag) {
  return xmlTextWriterWriteNs0ResponseElementNS(writer, _postFlag, 0);
}

/**
 * Writes a PostFlag to XML under element name "response".
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ResponseElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "response", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}postFlag for root element {}response...\n");
#endif
  status = xmlTextWriterWriteNs0PostFlagType(writer, _postFlag);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}response. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a PostFlag.
 *
 * @param _postFlag The PostFlag whose children are to be free.
 */
static void freeNs0ResponseElement(struct agentrank_ns0_postFlag *_postFlag) {
  freeNs0PostFlagType(_postFlag);
}

/**
 * Reads a PostFlag from XML. The reader is assumed to be at the start element.
 *
 * @return the PostFlag, or NULL in case of error.
 */
static struct agentrank_ns0_postFlag *xmlTextReaderReadNs0PostFlagType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_postFlag *_postFlag = calloc(1, sizeof(struct agentrank_ns0_postFlag));



  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0PostFlagType(_postFlag);
        free(_postFlag);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}status of type {}status.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0StatusType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}status of type {}status.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0PostFlagType(_postFlag);
          free(_postFlag);
          return NULL;
        }

        _postFlag->status = ((struct agentrank_ns0_status*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}postFlag.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}postFlag. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _postFlag;
}

/**
 * Writes a PostFlag to XML.
 *
 * @param writer The XML writer.
 * @param _postFlag The PostFlag to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0PostFlagType(xmlTextWriterPtr writer, struct agentrank_ns0_postFlag *_postFlag) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;
  if (_postFlag->status != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}status for element {}status...\n");
#endif
    status = xmlTextWriterWriteNs0StatusType(writer, (_postFlag->status));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}status for element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}status. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a PostFlag.
 *
 * @param _postFlag The PostFlag to free.
 */
static void freeNs0PostFlagType(struct agentrank_ns0_postFlag *_postFlag) {
  int i;
  if (_postFlag->status != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor status of type agentrank_ns0_postFlag...\n");
#endif
    freeNs0StatusType(_postFlag->status);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor status of type agentrank_ns0_postFlag...\n");
#endif
    free(_postFlag->status);
  }
}
#endif /* DEF_agentrank_ns0_postFlag_M */
#ifndef DEF_agentrank_ns0_profile_M
#define DEF_agentrank_ns0_profile_M

/**
 * Reads a Profile element from XML. The element to be read is "profile", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Profile, or NULL in case of error.
 */
struct agentrank_ns0_profile *xml_read_agentrank_ns0_profile(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ProfileElement(reader);
}

/**
 * Writes a Profile to XML under element name "profile".
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_profile(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile) {
  return xmlTextWriterWriteNs0ProfileElementNS(writer, _profile, 1);
}

/**
 * Frees a Profile.
 *
 * @param _profile The Profile to free.
 */
void free_agentrank_ns0_profile(struct agentrank_ns0_profile *_profile) {
  freeNs0ProfileType(_profile);
  free(_profile);
}

/**
 * Reads a Profile element from XML. The element to be read is "profile", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Profile, or NULL in case of error.
 */
struct agentrank_ns0_profile *xmlTextReaderReadNs0ProfileElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_profile *_profile = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "profile", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}profile.\n");
#endif
    _profile = xmlTextReaderReadNs0ProfileType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_profile == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}profile failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}profile failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _profile;
}

/**
 * Writes a Profile to XML under element name "profile".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ProfileElement(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile) {
  return xmlTextWriterWriteNs0ProfileElementNS(writer, _profile, 0);
}

/**
 * Writes a Profile to XML under element name "profile".
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ProfileElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "profile", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}profile. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}profile for root element {}profile...\n");
#endif
  status = xmlTextWriterWriteNs0ProfileType(writer, _profile);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}profile. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}profile. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Profile.
 *
 * @param _profile The Profile whose children are to be free.
 */
static void freeNs0ProfileElement(struct agentrank_ns0_profile *_profile) {
  freeNs0ProfileType(_profile);
}

/**
 * Reads a Profile from XML. The reader is assumed to be at the start element.
 *
 * @return the Profile, or NULL in case of error.
 */
static struct agentrank_ns0_profile *xmlTextReaderReadNs0ProfileType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_profile *_profile = calloc(1, sizeof(struct agentrank_ns0_profile));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}id...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}id of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }
        _profile->id = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "username", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}username...\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}username of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }
        _profile->username = ((xmlChar*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "activated", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}boolean from attribute {}activated...\n");
#endif
        _child_accessor = xmlTextReaderReadXsBooleanType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}activated of type {http://www.w3.org/2001/XMLSchema}boolean.\n");
#endif
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }
        _profile->activated = *((int*)_child_accessor);
        freeXsBooleanType((int*) _child_accessor);
        free(_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0ProfileType(_profile);
      free(_profile);
      return NULL;
    }
  }


  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ProfileType(_profile);
        free(_profile);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "link", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}link of type {}link.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0LinkType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}link of type {}link.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->link = ((struct agentrank_ns0_link*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "photo", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}photo of type {}image.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ImageType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}photo of type {}image.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->photo = ((struct agentrank_ns0_image*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "slugs", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}slugs of type {}slugs.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0SlugsType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}slugs of type {}slugs.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->slugs = ((struct agentrank_ns0_slugs*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "title", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}title of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->title = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "full_name", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}full_name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}full_name of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->full_name = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}description of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}description of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->description = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "rank", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}rank of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}rank of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->rank = ((int*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "sales", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}sales of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}sales of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->sales = ((int*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "reviews", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}reviews of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}reviews of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->reviews = ((int*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "forecasts", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}forecasts of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}forecasts of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->forecasts = ((int*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "experience", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}experience of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
        _child_accessor = xmlTextReaderReadXsDecimalType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}experience of type {http://www.w3.org/2001/XMLSchema}decimal.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfileType(_profile);
          free(_profile);
          return NULL;
        }

        _profile->experience = ((xmlChar*)_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}profile.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}profile. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _profile;
}

/**
 * Writes a Profile to XML.
 *
 * @param writer The XML writer.
 * @param _profile The Profile to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ProfileType(xmlTextWriterPtr writer, struct agentrank_ns0_profile *_profile) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_profile->id != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "id", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}id. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}id...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profile->id));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}id. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_profile->username != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "username", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}username. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for attribute {}username...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_profile->username));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for attribute {}username. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}username. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (1) { //always write the primitive attribute
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "activated", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}activated. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}activated...\n");
#endif
    status = xmlTextWriterWriteXsBooleanType(writer, &(_profile->activated));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}boolean for attribute {}activated. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}activated. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->link != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "link", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}link for element {}link...\n");
#endif
    status = xmlTextWriterWriteNs0LinkType(writer, (_profile->link));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}link for element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}link. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->photo != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "photo", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}photo. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}image for element {}photo...\n");
#endif
    status = xmlTextWriterWriteNs0ImageType(writer, (_profile->photo));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}image for element {}photo. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}photo. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->slugs != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "slugs", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {}slugs for element {}slugs...\n");
#endif
    status = xmlTextWriterWriteNs0SlugsType(writer, (_profile->slugs));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {}slugs for element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}slugs. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->title != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "title", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}title...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_profile->title));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}title. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->full_name != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "full_name", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}full_name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}full_name...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_profile->full_name));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}full_name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}full_name. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->description != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "description", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}description. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}string for element {}description...\n");
#endif
    status = xmlTextWriterWriteXsStringType(writer, (_profile->description));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}string for element {}description. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}description. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->rank != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "rank", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}rank. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}rank...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profile->rank));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}rank. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}rank. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->sales != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sales", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}sales...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profile->sales));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}sales. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->reviews != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "reviews", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}reviews...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profile->reviews));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}reviews. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->forecasts != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "forecasts", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for element {}forecasts...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profile->forecasts));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}forecasts. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }
  if (_profile->experience != NULL) {
    status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "experience", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start element {}experience. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}decimal for element {}experience...\n");
#endif
    status = xmlTextWriterWriteXsDecimalType(writer, (_profile->experience));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}decimal for element {}experience. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndElement(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end element {}experience. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  return totalBytes;
}

/**
 * Frees the elements of a Profile.
 *
 * @param _profile The Profile to free.
 */
static void freeNs0ProfileType(struct agentrank_ns0_profile *_profile) {
  int i;
  if (_profile->id != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor id of type agentrank_ns0_profile...\n");
#endif
    freeXsIntType(_profile->id);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor id of type agentrank_ns0_profile...\n");
#endif
    free(_profile->id);
  }
  if (_profile->username != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor username of type agentrank_ns0_profile...\n");
#endif
    freeXsStringType(_profile->username);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor username of type agentrank_ns0_profile...\n");
#endif
    free(_profile->username);
  }
  if (_profile->link != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor link of type agentrank_ns0_profile...\n");
#endif
    freeNs0LinkType(_profile->link);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor link of type agentrank_ns0_profile...\n");
#endif
    free(_profile->link);
  }
  if (_profile->photo != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor photo of type agentrank_ns0_profile...\n");
#endif
    freeNs0ImageType(_profile->photo);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor photo of type agentrank_ns0_profile...\n");
#endif
    free(_profile->photo);
  }
  if (_profile->slugs != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor slugs of type agentrank_ns0_profile...\n");
#endif
    freeNs0SlugsType(_profile->slugs);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor slugs of type agentrank_ns0_profile...\n");
#endif
    free(_profile->slugs);
  }
  if (_profile->title != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor title of type agentrank_ns0_profile...\n");
#endif
    freeXsStringType(_profile->title);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor title of type agentrank_ns0_profile...\n");
#endif
    free(_profile->title);
  }
  if (_profile->full_name != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor full_name of type agentrank_ns0_profile...\n");
#endif
    freeXsStringType(_profile->full_name);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor full_name of type agentrank_ns0_profile...\n");
#endif
    free(_profile->full_name);
  }
  if (_profile->description != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor description of type agentrank_ns0_profile...\n");
#endif
    freeXsStringType(_profile->description);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor description of type agentrank_ns0_profile...\n");
#endif
    free(_profile->description);
  }
  if (_profile->rank != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor rank of type agentrank_ns0_profile...\n");
#endif
    freeXsIntType(_profile->rank);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor rank of type agentrank_ns0_profile...\n");
#endif
    free(_profile->rank);
  }
  if (_profile->sales != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor sales of type agentrank_ns0_profile...\n");
#endif
    freeXsIntType(_profile->sales);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor sales of type agentrank_ns0_profile...\n");
#endif
    free(_profile->sales);
  }
  if (_profile->reviews != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor reviews of type agentrank_ns0_profile...\n");
#endif
    freeXsIntType(_profile->reviews);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor reviews of type agentrank_ns0_profile...\n");
#endif
    free(_profile->reviews);
  }
  if (_profile->forecasts != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor forecasts of type agentrank_ns0_profile...\n");
#endif
    freeXsIntType(_profile->forecasts);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor forecasts of type agentrank_ns0_profile...\n");
#endif
    free(_profile->forecasts);
  }
  if (_profile->experience != NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Freeing type of accessor experience of type agentrank_ns0_profile...\n");
#endif
    freeXsDecimalType(_profile->experience);
#if DEBUG_ENUNCIATE > 1
    printf("Freeing accessor experience of type agentrank_ns0_profile...\n");
#endif
    free(_profile->experience);
  }
}
#endif /* DEF_agentrank_ns0_profile_M */
#ifndef DEF_agentrank_ns0_profiles_M
#define DEF_agentrank_ns0_profiles_M

/**
 * Reads a Profiles element from XML. The element to be read is "profiles", and
 * it is assumed that the reader is pointing to the XML document (not the element).
 *
 * @param reader The XML reader.
 * @return The Profiles, or NULL in case of error.
 */
struct agentrank_ns0_profiles *xml_read_agentrank_ns0_profiles(xmlTextReaderPtr reader) {
  int status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
  return xmlTextReaderReadNs0ProfilesElement(reader);
}

/**
 * Writes a Profiles to XML under element name "profiles".
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return 1 if successful, 0 otherwise.
 */
int xml_write_agentrank_ns0_profiles(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles) {
  return xmlTextWriterWriteNs0ProfilesElementNS(writer, _profiles, 1);
}

/**
 * Frees a Profiles.
 *
 * @param _profiles The Profiles to free.
 */
void free_agentrank_ns0_profiles(struct agentrank_ns0_profiles *_profiles) {
  freeNs0ProfilesType(_profiles);
  free(_profiles);
}

/**
 * Reads a Profiles element from XML. The element to be read is "profiles", and
 * it is assumed that the reader is pointing to that element.
 *
 * @param reader The XML reader.
 * @return The Profiles, or NULL in case of error.
 */
struct agentrank_ns0_profiles *xmlTextReaderReadNs0ProfilesElement(xmlTextReaderPtr reader) {
  struct agentrank_ns0_profiles *_profiles = NULL;

  if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
    && xmlStrcmp(BAD_CAST "profiles", xmlTextReaderConstLocalName(reader)) == 0
    && xmlTextReaderConstNamespaceUri(reader) == NULL) {
#if DEBUG_ENUNCIATE > 1
    printf("Attempting to read root element {}profiles.\n");
#endif
    _profiles = xmlTextReaderReadNs0ProfilesType(reader);
  }
#if DEBUG_ENUNCIATE
  if (_profiles == NULL) {
    if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
      printf("attempt to read {}profiles failed. current element: {}%s\n",  xmlTextReaderConstLocalName(reader));
    }
    else {
      printf("attempt to read {}profiles failed. current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
    }
  }
#endif

  return _profiles;
}

/**
 * Writes a Profiles to XML under element name "profiles".
 * Does NOT write the namespace prefixes.
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ProfilesElement(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles) {
  return xmlTextWriterWriteNs0ProfilesElementNS(writer, _profiles, 0);
}

/**
 * Writes a Profiles to XML under element name "profiles".
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @param writeNamespaces Whether to write the namespace prefixes.
 * @return 1 if successful, 0 otherwise.
 */
static int xmlTextWriterWriteNs0ProfilesElementNS(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles, int writeNamespaces) {
  int totalBytes = 0;
  int status;

  status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "profiles", NULL);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write start element {}profiles. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

#if DEBUG_ENUNCIATE > 1
  printf("writing type {}profiles for root element {}profiles...\n");
#endif
  status = xmlTextWriterWriteNs0ProfilesType(writer, _profiles);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to write type for start element {}profiles. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  status = xmlTextWriterEndElement(writer);
  if (status < 0) {
#if DEBUG_ENUNCIATE
    printf("unable to end element {}profiles. status: %i\n", status);
#endif
    return status;
  }
  totalBytes += status;

  return totalBytes;
}

/**
 * Frees the children of a Profiles.
 *
 * @param _profiles The Profiles whose children are to be free.
 */
static void freeNs0ProfilesElement(struct agentrank_ns0_profiles *_profiles) {
  freeNs0ProfilesType(_profiles);
}

/**
 * Reads a Profiles from XML. The reader is assumed to be at the start element.
 *
 * @return the Profiles, or NULL in case of error.
 */
static struct agentrank_ns0_profiles *xmlTextReaderReadNs0ProfilesType(xmlTextReaderPtr reader) {
  int status, depth;
  void *_child_accessor;
  struct agentrank_ns0_profiles *_profiles = calloc(1, sizeof(struct agentrank_ns0_profiles));

  if (xmlTextReaderHasAttributes(reader)) {
    while (xmlTextReaderMoveToNextAttribute(reader)) {
      if ((xmlStrcmp(BAD_CAST "start_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}start_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}start_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->start_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "max_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}max_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}max_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->max_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "last_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}last_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}last_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->last_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "total_results", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}total_results...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}total_results of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->total_results = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "first_index", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}int from attribute {}first_index...\n");
#endif
        _child_accessor = xmlTextReaderReadXsIntType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}first_index of type {http://www.w3.org/2001/XMLSchema}int.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->first_index = ((int*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "location", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {http://www.w3.org/2001/XMLSchema}string from attribute {}location...\n");
#endif
        _child_accessor = xmlTextReaderReadXsStringType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}location of type {http://www.w3.org/2001/XMLSchema}string.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->location = ((xmlChar*)_child_accessor);
        continue;
      }
      if ((xmlStrcmp(BAD_CAST "context", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read type {}locationContext from attribute {}context...\n");
#endif
        _child_accessor = xmlTextReaderReadNs0LocationContextType(reader);
        if (_child_accessor == NULL) {
          //panic: unable to return the attribute value for some reason.
#if DEBUG_ENUNCIATE
          printf("Failed to read attribute {}context of type {}locationContext.\n");
#endif
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }
        _profiles->context = ((enum agentrank_ns0_locationContext*)_child_accessor);
        continue;
      }
    }

    status = xmlTextReaderMoveToElement(reader);
    if (status < 1) {
      //panic: unable to return to the element node.
#if DEBUG_ENUNCIATE
      printf("Unable to return to element node from attributes.\n");
#endif
      freeNs0ProfilesType(_profiles);
      free(_profiles);
      return NULL;
    }
  }


  if (xmlTextReaderIsEmptyElement(reader) == 0) {
    depth = xmlTextReaderDepth(reader);//track the depth.
    status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);

    while (xmlTextReaderDepth(reader) > depth) {
      if (status < 1) {
        //panic: XML read error.
#if DEBUG_ENUNCIATE
        printf("Failure to advance to next child element.\n");
#endif
        freeNs0ProfilesType(_profiles);
        free(_profiles);
        return NULL;
      }
      else if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
        && xmlStrcmp(BAD_CAST "profile", xmlTextReaderConstLocalName(reader)) == 0
        && xmlTextReaderConstNamespaceUri(reader) == NULL) {

#if DEBUG_ENUNCIATE > 1
        printf("Attempting to read choice {}profile of type {}profile.\n");
#endif
        _child_accessor = xmlTextReaderReadNs0ProfileType(reader);
        if (_child_accessor == NULL) {
#if DEBUG_ENUNCIATE
          printf("Failed to read choice {}profile of type {}profile.\n");
#endif
          //panic: unable to read the child element for some reason.
          freeNs0ProfilesType(_profiles);
          free(_profiles);
          return NULL;
        }

        _profiles->profile = realloc(_profiles->profile, (_profiles->_sizeof_profile + 1) * sizeof(struct agentrank_ns0_profile));
        memcpy(&(_profiles->profile[_profiles->_sizeof_profile++]), _child_accessor, sizeof(struct agentrank_ns0_profile));
        free(_child_accessor);
        status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
      }
      else {
#if DEBUG_ENUNCIATE > 1
        if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
          printf("unknown child element {}%s for type {}profiles.  Skipping...\n",  xmlTextReaderConstLocalName(reader));
        }
        else {
          printf("unknown child element {%s}%s for type {}profiles. Skipping...\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader));
        }
#endif
        status = xmlTextReaderSkipElement(reader);
      }
    }
  }

  return _profiles;
}

/**
 * Writes a Profiles to XML.
 *
 * @param writer The XML writer.
 * @param _profiles The Profiles to write.
 * @return The total bytes written, or -1 on error;
 */
static int xmlTextWriterWriteNs0ProfilesType(xmlTextWriterPtr writer, struct agentrank_ns0_profiles *_profiles) {
  int status, totalBytes = 0, i;
  xmlChar *binaryData;

  if (_profiles->start_index != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "start_index", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}start_index. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index...\n");
#endif
    status = xmlTextWriterWriteXsIntType(writer, (_profiles->start_index));
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write type {http://www.w3.org/2001/XMLSchema}int for attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;

    status = xmlTextWriterEndAttribute(writer);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write end attribute {}start_index. status: %i", status);
#endif
      return status;
    }
    totalBytes += status;
  }

  if (_profiles->max_results != NULL) {
    status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "max_results", NULL);
    if (status < 0) {
#if DEBUG_ENUNCIATE
      printf("Failed to write start attribute {}max_results. status: %i\n", status);
#endif
      return status;
    }
    totalBytes += status;

#if DEBUG_ENUNCIATE > 1
    printf("writing type {http://www.w3.org/2001/XMLSchema}int for attribute {}max_results...\n");
#endif
    st
