// Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//

// Begin prologue.
//
#if __clang__ || __GNUC__ >= 4
	#pragma GCC diagnostic push
	#pragma GCC diagnostic ignored "-Wfloat-equal"
	#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#ifndef __ANDROID__
	#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#endif
//
// End prologue.

#include <xsd/cxx/pre.hxx>

#include "reginfo.hh"

namespace reginfo
{
  // Reginfo
  // 

  const Reginfo::RegistrationSequence& Reginfo::
  getRegistration () const
  {
    return this->registration_;
  }

  Reginfo::RegistrationSequence& Reginfo::
  getRegistration ()
  {
    return this->registration_;
  }

  void Reginfo::
  setRegistration (const RegistrationSequence& s)
  {
    this->registration_ = s;
  }

  const Reginfo::AnySequence& Reginfo::
  getAny () const
  {
    return this->any_;
  }

  Reginfo::AnySequence& Reginfo::
  getAny ()
  {
    return this->any_;
  }

  void Reginfo::
  setAny (const AnySequence& s)
  {
    this->any_ = s;
  }

  const Reginfo::VersionType& Reginfo::
  getVersion () const
  {
    return this->version_.get ();
  }

  Reginfo::VersionType& Reginfo::
  getVersion ()
  {
    return this->version_.get ();
  }

  void Reginfo::
  setVersion (const VersionType& x)
  {
    this->version_.set (x);
  }

  const Reginfo::StateType& Reginfo::
  getState () const
  {
    return this->state_.get ();
  }

  Reginfo::StateType& Reginfo::
  getState ()
  {
    return this->state_.get ();
  }

  void Reginfo::
  setState (const StateType& x)
  {
    this->state_.set (x);
  }

  void Reginfo::
  setState (::std::unique_ptr< StateType > x)
  {
    this->state_.set (std::move (x));
  }

  ::std::unique_ptr< Reginfo::StateType > Reginfo::
  setDetachState ()
  {
    return this->state_.detach ();
  }

  const ::xercesc::DOMDocument& Reginfo::
  getDomDocument () const
  {
    return *this->dom_document_;
  }

  ::xercesc::DOMDocument& Reginfo::
  getDomDocument ()
  {
    return *this->dom_document_;
  }


  // Registration
  // 

  const Registration::ContactSequence& Registration::
  getContact () const
  {
    return this->contact_;
  }

  Registration::ContactSequence& Registration::
  getContact ()
  {
    return this->contact_;
  }

  void Registration::
  setContact (const ContactSequence& s)
  {
    this->contact_ = s;
  }

  const Registration::AnySequence& Registration::
  getAny () const
  {
    return this->any_;
  }

  Registration::AnySequence& Registration::
  getAny ()
  {
    return this->any_;
  }

  void Registration::
  setAny (const AnySequence& s)
  {
    this->any_ = s;
  }

  const Registration::AorType& Registration::
  getAor () const
  {
    return this->aor_.get ();
  }

  Registration::AorType& Registration::
  getAor ()
  {
    return this->aor_.get ();
  }

  void Registration::
  setAor (const AorType& x)
  {
    this->aor_.set (x);
  }

  void Registration::
  setAor (::std::unique_ptr< AorType > x)
  {
    this->aor_.set (std::move (x));
  }

  ::std::unique_ptr< Registration::AorType > Registration::
  setDetachAor ()
  {
    return this->aor_.detach ();
  }

  const Registration::IdType& Registration::
  getId () const
  {
    return this->id_.get ();
  }

  Registration::IdType& Registration::
  getId ()
  {
    return this->id_.get ();
  }

  void Registration::
  setId (const IdType& x)
  {
    this->id_.set (x);
  }

  void Registration::
  setId (::std::unique_ptr< IdType > x)
  {
    this->id_.set (std::move (x));
  }

  ::std::unique_ptr< Registration::IdType > Registration::
  setDetachId ()
  {
    return this->id_.detach ();
  }

  const Registration::StateType& Registration::
  getState () const
  {
    return this->state_.get ();
  }

  Registration::StateType& Registration::
  getState ()
  {
    return this->state_.get ();
  }

  void Registration::
  setState (const StateType& x)
  {
    this->state_.set (x);
  }

  void Registration::
  setState (::std::unique_ptr< StateType > x)
  {
    this->state_.set (std::move (x));
  }

  ::std::unique_ptr< Registration::StateType > Registration::
  setDetachState ()
  {
    return this->state_.detach ();
  }

  const ::xercesc::DOMDocument& Registration::
  getDomDocument () const
  {
    return *this->dom_document_;
  }

  ::xercesc::DOMDocument& Registration::
  getDomDocument ()
  {
    return *this->dom_document_;
  }


  // Contact
  // 

  const Contact::UriType& Contact::
  getUri () const
  {
    return this->uri_.get ();
  }

  Contact::UriType& Contact::
  getUri ()
  {
    return this->uri_.get ();
  }

  void Contact::
  setUri (const UriType& x)
  {
    this->uri_.set (x);
  }

  void Contact::
  setUri (::std::unique_ptr< UriType > x)
  {
    this->uri_.set (std::move (x));
  }

  ::std::unique_ptr< Contact::UriType > Contact::
  setDetachUri ()
  {
    return this->uri_.detach ();
  }

  const Contact::DisplayNameOptional& Contact::
  getDisplayName () const
  {
    return this->display_name_;
  }

  Contact::DisplayNameOptional& Contact::
  getDisplayName ()
  {
    return this->display_name_;
  }

  void Contact::
  setDisplayName (const DisplayNameType& x)
  {
    this->display_name_.set (x);
  }

  void Contact::
  setDisplayName (const DisplayNameOptional& x)
  {
    this->display_name_ = x;
  }

  void Contact::
  setDisplayName (::std::unique_ptr< DisplayNameType > x)
  {
    this->display_name_.set (std::move (x));
  }

  const Contact::UnknownParamSequence& Contact::
  getUnknownParam () const
  {
    return this->unknown_param_;
  }

  Contact::UnknownParamSequence& Contact::
  getUnknownParam ()
  {
    return this->unknown_param_;
  }

  void Contact::
  setUnknownParam (const UnknownParamSequence& s)
  {
    this->unknown_param_ = s;
  }

  const Contact::AnySequence& Contact::
  getAny () const
  {
    return this->any_;
  }

  Contact::AnySequence& Contact::
  getAny ()
  {
    return this->any_;
  }

  void Contact::
  setAny (const AnySequence& s)
  {
    this->any_ = s;
  }

  const Contact::StateType& Contact::
  getState () const
  {
    return this->state_.get ();
  }

  Contact::StateType& Contact::
  getState ()
  {
    return this->state_.get ();
  }

  void Contact::
  setState (const StateType& x)
  {
    this->state_.set (x);
  }

  void Contact::
  setState (::std::unique_ptr< StateType > x)
  {
    this->state_.set (std::move (x));
  }

  ::std::unique_ptr< Contact::StateType > Contact::
  setDetachState ()
  {
    return this->state_.detach ();
  }

  const Contact::EventType& Contact::
  getEvent () const
  {
    return this->event_.get ();
  }

  Contact::EventType& Contact::
  getEvent ()
  {
    return this->event_.get ();
  }

  void Contact::
  setEvent (const EventType& x)
  {
    this->event_.set (x);
  }

  void Contact::
  setEvent (::std::unique_ptr< EventType > x)
  {
    this->event_.set (std::move (x));
  }

  ::std::unique_ptr< Contact::EventType > Contact::
  setDetachEvent ()
  {
    return this->event_.detach ();
  }

  const Contact::DurationRegisteredOptional& Contact::
  getDurationRegistered () const
  {
    return this->duration_registered_;
  }

  Contact::DurationRegisteredOptional& Contact::
  getDurationRegistered ()
  {
    return this->duration_registered_;
  }

  void Contact::
  setDurationRegistered (const DurationRegisteredType& x)
  {
    this->duration_registered_.set (x);
  }

  void Contact::
  setDurationRegistered (const DurationRegisteredOptional& x)
  {
    this->duration_registered_ = x;
  }

  const Contact::ExpiresOptional& Contact::
  getExpires () const
  {
    return this->expires_;
  }

  Contact::ExpiresOptional& Contact::
  getExpires ()
  {
    return this->expires_;
  }

  void Contact::
  setExpires (const ExpiresType& x)
  {
    this->expires_.set (x);
  }

  void Contact::
  setExpires (const ExpiresOptional& x)
  {
    this->expires_ = x;
  }

  const Contact::RetryAfterOptional& Contact::
  getRetryAfter () const
  {
    return this->retry_after_;
  }

  Contact::RetryAfterOptional& Contact::
  getRetryAfter ()
  {
    return this->retry_after_;
  }

  void Contact::
  setRetryAfter (const RetryAfterType& x)
  {
    this->retry_after_.set (x);
  }

  void Contact::
  setRetryAfter (const RetryAfterOptional& x)
  {
    this->retry_after_ = x;
  }

  const Contact::IdType& Contact::
  getId () const
  {
    return this->id_.get ();
  }

  Contact::IdType& Contact::
  getId ()
  {
    return this->id_.get ();
  }

  void Contact::
  setId (const IdType& x)
  {
    this->id_.set (x);
  }

  void Contact::
  setId (::std::unique_ptr< IdType > x)
  {
    this->id_.set (std::move (x));
  }

  ::std::unique_ptr< Contact::IdType > Contact::
  setDetachId ()
  {
    return this->id_.detach ();
  }

  const Contact::QOptional& Contact::
  getQ () const
  {
    return this->q_;
  }

  Contact::QOptional& Contact::
  getQ ()
  {
    return this->q_;
  }

  void Contact::
  setQ (const QType& x)
  {
    this->q_.set (x);
  }

  void Contact::
  setQ (const QOptional& x)
  {
    this->q_ = x;
  }

  void Contact::
  setQ (::std::unique_ptr< QType > x)
  {
    this->q_.set (std::move (x));
  }

  const Contact::CallidOptional& Contact::
  getCallid () const
  {
    return this->callid_;
  }

  Contact::CallidOptional& Contact::
  getCallid ()
  {
    return this->callid_;
  }

  void Contact::
  setCallid (const CallidType& x)
  {
    this->callid_.set (x);
  }

  void Contact::
  setCallid (const CallidOptional& x)
  {
    this->callid_ = x;
  }

  void Contact::
  setCallid (::std::unique_ptr< CallidType > x)
  {
    this->callid_.set (std::move (x));
  }

  const Contact::CseqOptional& Contact::
  getCseq () const
  {
    return this->cseq_;
  }

  Contact::CseqOptional& Contact::
  getCseq ()
  {
    return this->cseq_;
  }

  void Contact::
  setCseq (const CseqType& x)
  {
    this->cseq_.set (x);
  }

  void Contact::
  setCseq (const CseqOptional& x)
  {
    this->cseq_ = x;
  }

  const ::xercesc::DOMDocument& Contact::
  getDomDocument () const
  {
    return *this->dom_document_;
  }

  ::xercesc::DOMDocument& Contact::
  getDomDocument ()
  {
    return *this->dom_document_;
  }


  // State
  // 

  State::
  State (Value v)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_State_literals_[v])
  {
  }

  State::
  State (const char* v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State::
  State (const ::std::string& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State::
  State (const ::flexisip::Xsd::XmlSchema::String& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State::
  State (const State& v,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (v, f, c)
  {
  }

  State& State::
  operator= (Value v)
  {
    static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = 
    ::flexisip::Xsd::XmlSchema::String (_xsd_State_literals_[v]);

    return *this;
  }


  // State1
  // 

  State1::
  State1 (Value v)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_State1_literals_[v])
  {
  }

  State1::
  State1 (const char* v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State1::
  State1 (const ::std::string& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State1::
  State1 (const ::flexisip::Xsd::XmlSchema::String& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State1::
  State1 (const State1& v,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (v, f, c)
  {
  }

  State1& State1::
  operator= (Value v)
  {
    static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = 
    ::flexisip::Xsd::XmlSchema::String (_xsd_State1_literals_[v]);

    return *this;
  }


  // DisplayName
  // 

  const DisplayName::LangOptional& DisplayName::
  getLang () const
  {
    return this->lang_;
  }

  DisplayName::LangOptional& DisplayName::
  getLang ()
  {
    return this->lang_;
  }

  void DisplayName::
  setLang (const LangType& x)
  {
    this->lang_.set (x);
  }

  void DisplayName::
  setLang (const LangOptional& x)
  {
    this->lang_ = x;
  }

  void DisplayName::
  setLang (::std::unique_ptr< LangType > x)
  {
    this->lang_.set (std::move (x));
  }


  // UnknownParam
  // 

  const UnknownParam::NameType& UnknownParam::
  getName () const
  {
    return this->name_.get ();
  }

  UnknownParam::NameType& UnknownParam::
  getName ()
  {
    return this->name_.get ();
  }

  void UnknownParam::
  setName (const NameType& x)
  {
    this->name_.set (x);
  }

  void UnknownParam::
  setName (::std::unique_ptr< NameType > x)
  {
    this->name_.set (std::move (x));
  }

  ::std::unique_ptr< UnknownParam::NameType > UnknownParam::
  setDetachName ()
  {
    return this->name_.detach ();
  }


  // State2
  // 

  State2::
  State2 (Value v)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_State2_literals_[v])
  {
  }

  State2::
  State2 (const char* v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State2::
  State2 (const ::std::string& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State2::
  State2 (const ::flexisip::Xsd::XmlSchema::String& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  State2::
  State2 (const State2& v,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (v, f, c)
  {
  }

  State2& State2::
  operator= (Value v)
  {
    static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = 
    ::flexisip::Xsd::XmlSchema::String (_xsd_State2_literals_[v]);

    return *this;
  }


  // Event
  // 

  Event::
  Event (Value v)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_Event_literals_[v])
  {
  }

  Event::
  Event (const char* v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  Event::
  Event (const ::std::string& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  Event::
  Event (const ::flexisip::Xsd::XmlSchema::String& v)
  : ::flexisip::Xsd::XmlSchema::String (v)
  {
  }

  Event::
  Event (const Event& v,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (v, f, c)
  {
  }

  Event& Event::
  operator= (Value v)
  {
    static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = 
    ::flexisip::Xsd::XmlSchema::String (_xsd_Event_literals_[v]);

    return *this;
  }
}

#include <xsd/cxx/xml/dom/wildcard-source.hxx>

#include <xsd/cxx/xml/dom/parsing-source.hxx>

namespace reginfo
{
  // Reginfo
  //

  Reginfo::
  Reginfo (const VersionType& version,
           const StateType& state)
  : ::flexisip::Xsd::XmlSchema::Type (),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    registration_ (this),
    any_ (this->getDomDocument ()),
    version_ (version, this),
    state_ (state, this)
  {
  }

  Reginfo::
  Reginfo (const Reginfo& x,
           ::flexisip::Xsd::XmlSchema::Flags f,
           ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (x, f, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    registration_ (x.registration_, f, this),
    any_ (x.any_, this->getDomDocument ()),
    version_ (x.version_, f, this),
    state_ (x.state_, f, this)
  {
  }

  Reginfo::
  Reginfo (const ::xercesc::DOMElement& e,
           ::flexisip::Xsd::XmlSchema::Flags f,
           ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    registration_ (this),
    any_ (this->getDomDocument ()),
    version_ (this),
    state_ (this)
  {
    if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
    {
      ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
      this->parse (p, f);
    }
  }

  void Reginfo::
  parse (::xsd::cxx::xml::dom::parser< char >& p,
         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    for (; p.more_content (); p.next_content (false))
    {
      const ::xercesc::DOMElement& i (p.cur_element ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      // registration
      //
      if (n.name () == "registration" && n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
      {
        ::std::unique_ptr< RegistrationType > r (
          RegistrationTraits::create (i, f, this));

        this->registration_.push_back (::std::move (r));
        continue;
      }

      // any
      //
      if ((!n.namespace_ ().empty () && n.namespace_ () != "urn:ietf:params:xml:ns:reginfo"))
      {
        ::xercesc::DOMElement* r (
          static_cast< ::xercesc::DOMElement* > (
            this->getDomDocument ().importNode (
              const_cast< ::xercesc::DOMElement* > (&i), true)));
        this->any_.push_back (r);
        continue;
      }

      break;
    }

    while (p.more_attributes ())
    {
      const ::xercesc::DOMAttr& i (p.next_attribute ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      if (n.name () == "version" && n.namespace_ ().empty ())
      {
        this->version_.set (VersionTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "state" && n.namespace_ ().empty ())
      {
        this->state_.set (StateTraits::create (i, f, this));
        continue;
      }
    }

    if (!version_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "version",
        "");
    }

    if (!state_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "state",
        "");
    }
  }

  Reginfo* Reginfo::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class Reginfo (*this, f, c);
  }

  Reginfo& Reginfo::
  operator= (const Reginfo& x)
  {
    if (this != &x)
    {
      static_cast< ::flexisip::Xsd::XmlSchema::Type& > (*this) = x;
      this->registration_ = x.registration_;
      this->any_ = x.any_;
      this->version_ = x.version_;
      this->state_ = x.state_;
    }

    return *this;
  }

  Reginfo::
  ~Reginfo ()
  {
  }

  // Registration
  //

  Registration::
  Registration (const AorType& aor,
                const IdType& id,
                const StateType& state)
  : ::flexisip::Xsd::XmlSchema::Type (),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    contact_ (this),
    any_ (this->getDomDocument ()),
    aor_ (aor, this),
    id_ (id, this),
    state_ (state, this)
  {
  }

  Registration::
  Registration (const Registration& x,
                ::flexisip::Xsd::XmlSchema::Flags f,
                ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (x, f, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    contact_ (x.contact_, f, this),
    any_ (x.any_, this->getDomDocument ()),
    aor_ (x.aor_, f, this),
    id_ (x.id_, f, this),
    state_ (x.state_, f, this)
  {
  }

  Registration::
  Registration (const ::xercesc::DOMElement& e,
                ::flexisip::Xsd::XmlSchema::Flags f,
                ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    contact_ (this),
    any_ (this->getDomDocument ()),
    aor_ (this),
    id_ (this),
    state_ (this)
  {
    if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
    {
      ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
      this->parse (p, f);
    }
  }

  void Registration::
  parse (::xsd::cxx::xml::dom::parser< char >& p,
         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    for (; p.more_content (); p.next_content (false))
    {
      const ::xercesc::DOMElement& i (p.cur_element ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      // contact
      //
      if (n.name () == "contact" && n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
      {
        ::std::unique_ptr< ContactType > r (
          ContactTraits::create (i, f, this));

        this->contact_.push_back (::std::move (r));
        continue;
      }

      // any
      //
      if ((!n.namespace_ ().empty () && n.namespace_ () != "urn:ietf:params:xml:ns:reginfo"))
      {
        ::xercesc::DOMElement* r (
          static_cast< ::xercesc::DOMElement* > (
            this->getDomDocument ().importNode (
              const_cast< ::xercesc::DOMElement* > (&i), true)));
        this->any_.push_back (r);
        continue;
      }

      break;
    }

    while (p.more_attributes ())
    {
      const ::xercesc::DOMAttr& i (p.next_attribute ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      if (n.name () == "aor" && n.namespace_ ().empty ())
      {
        this->aor_.set (AorTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "id" && n.namespace_ ().empty ())
      {
        this->id_.set (IdTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "state" && n.namespace_ ().empty ())
      {
        this->state_.set (StateTraits::create (i, f, this));
        continue;
      }
    }

    if (!aor_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "aor",
        "");
    }

    if (!id_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "id",
        "");
    }

    if (!state_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "state",
        "");
    }
  }

  Registration* Registration::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class Registration (*this, f, c);
  }

  Registration& Registration::
  operator= (const Registration& x)
  {
    if (this != &x)
    {
      static_cast< ::flexisip::Xsd::XmlSchema::Type& > (*this) = x;
      this->contact_ = x.contact_;
      this->any_ = x.any_;
      this->aor_ = x.aor_;
      this->id_ = x.id_;
      this->state_ = x.state_;
    }

    return *this;
  }

  Registration::
  ~Registration ()
  {
  }

  // Contact
  //

  Contact::
  Contact (const UriType& uri,
           const StateType& state,
           const EventType& event,
           const IdType& id)
  : ::flexisip::Xsd::XmlSchema::Type (),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    uri_ (uri, this),
    display_name_ (this),
    unknown_param_ (this),
    any_ (this->getDomDocument ()),
    state_ (state, this),
    event_ (event, this),
    duration_registered_ (this),
    expires_ (this),
    retry_after_ (this),
    id_ (id, this),
    q_ (this),
    callid_ (this),
    cseq_ (this)
  {
  }

  Contact::
  Contact (const Contact& x,
           ::flexisip::Xsd::XmlSchema::Flags f,
           ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (x, f, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    uri_ (x.uri_, f, this),
    display_name_ (x.display_name_, f, this),
    unknown_param_ (x.unknown_param_, f, this),
    any_ (x.any_, this->getDomDocument ()),
    state_ (x.state_, f, this),
    event_ (x.event_, f, this),
    duration_registered_ (x.duration_registered_, f, this),
    expires_ (x.expires_, f, this),
    retry_after_ (x.retry_after_, f, this),
    id_ (x.id_, f, this),
    q_ (x.q_, f, this),
    callid_ (x.callid_, f, this),
    cseq_ (x.cseq_, f, this)
  {
  }

  Contact::
  Contact (const ::xercesc::DOMElement& e,
           ::flexisip::Xsd::XmlSchema::Flags f,
           ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::Type (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
    dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
    uri_ (this),
    display_name_ (this),
    unknown_param_ (this),
    any_ (this->getDomDocument ()),
    state_ (this),
    event_ (this),
    duration_registered_ (this),
    expires_ (this),
    retry_after_ (this),
    id_ (this),
    q_ (this),
    callid_ (this),
    cseq_ (this)
  {
    if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
    {
      ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
      this->parse (p, f);
    }
  }

  void Contact::
  parse (::xsd::cxx::xml::dom::parser< char >& p,
         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    for (; p.more_content (); p.next_content (false))
    {
      const ::xercesc::DOMElement& i (p.cur_element ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      // uri
      //
      if (n.name () == "uri" && n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
      {
        ::std::unique_ptr< UriType > r (
          UriTraits::create (i, f, this));

        if (!uri_.present ())
        {
          this->uri_.set (::std::move (r));
          continue;
        }
      }

      // display-name
      //
      if (n.name () == "display-name" && n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
      {
        ::std::unique_ptr< DisplayNameType > r (
          DisplayNameTraits::create (i, f, this));

        if (!this->display_name_)
        {
          this->display_name_.set (::std::move (r));
          continue;
        }
      }

      // unknown-param
      //
      if (n.name () == "unknown-param" && n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
      {
        ::std::unique_ptr< UnknownParamType > r (
          UnknownParamTraits::create (i, f, this));

        this->unknown_param_.push_back (::std::move (r));
        continue;
      }

      // any
      //
      if ((!n.namespace_ ().empty () && n.namespace_ () != "urn:ietf:params:xml:ns:reginfo"))
      {
        ::xercesc::DOMElement* r (
          static_cast< ::xercesc::DOMElement* > (
            this->getDomDocument ().importNode (
              const_cast< ::xercesc::DOMElement* > (&i), true)));
        this->any_.push_back (r);
        continue;
      }

      break;
    }

    if (!uri_.present ())
    {
      throw ::xsd::cxx::tree::expected_element< char > (
        "uri",
        "urn:ietf:params:xml:ns:reginfo");
    }

    while (p.more_attributes ())
    {
      const ::xercesc::DOMAttr& i (p.next_attribute ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      if (n.name () == "state" && n.namespace_ ().empty ())
      {
        this->state_.set (StateTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "event" && n.namespace_ ().empty ())
      {
        this->event_.set (EventTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "duration-registered" && n.namespace_ ().empty ())
      {
        this->duration_registered_.set (DurationRegisteredTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "expires" && n.namespace_ ().empty ())
      {
        this->expires_.set (ExpiresTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "retry-after" && n.namespace_ ().empty ())
      {
        this->retry_after_.set (RetryAfterTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "id" && n.namespace_ ().empty ())
      {
        this->id_.set (IdTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "q" && n.namespace_ ().empty ())
      {
        this->q_.set (QTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "callid" && n.namespace_ ().empty ())
      {
        this->callid_.set (CallidTraits::create (i, f, this));
        continue;
      }

      if (n.name () == "cseq" && n.namespace_ ().empty ())
      {
        this->cseq_.set (CseqTraits::create (i, f, this));
        continue;
      }
    }

    if (!state_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "state",
        "");
    }

    if (!event_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "event",
        "");
    }

    if (!id_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "id",
        "");
    }
  }

  Contact* Contact::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class Contact (*this, f, c);
  }

  Contact& Contact::
  operator= (const Contact& x)
  {
    if (this != &x)
    {
      static_cast< ::flexisip::Xsd::XmlSchema::Type& > (*this) = x;
      this->uri_ = x.uri_;
      this->display_name_ = x.display_name_;
      this->unknown_param_ = x.unknown_param_;
      this->any_ = x.any_;
      this->state_ = x.state_;
      this->event_ = x.event_;
      this->duration_registered_ = x.duration_registered_;
      this->expires_ = x.expires_;
      this->retry_after_ = x.retry_after_;
      this->id_ = x.id_;
      this->q_ = x.q_;
      this->callid_ = x.callid_;
      this->cseq_ = x.cseq_;
    }

    return *this;
  }

  Contact::
  ~Contact ()
  {
  }

  // State
  //

  State::
  State (const ::xercesc::DOMElement& e,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f, c)
  {
    _xsd_State_convert ();
  }

  State::
  State (const ::xercesc::DOMAttr& a,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (a, f, c)
  {
    _xsd_State_convert ();
  }

  State::
  State (const ::std::string& s,
         const ::xercesc::DOMElement* e,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (s, e, f, c)
  {
    _xsd_State_convert ();
  }

  State* State::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class State (*this, f, c);
  }

  State::Value State::
  _xsd_State_convert () const
  {
    ::xsd::cxx::tree::enum_comparator< char > c (_xsd_State_literals_);
    const Value* i (::std::lower_bound (
                      _xsd_State_indexes_,
                      _xsd_State_indexes_ + 2,
                      *this,
                      c));

    if (i == _xsd_State_indexes_ + 2 || _xsd_State_literals_[*i] != *this)
    {
      throw ::xsd::cxx::tree::unexpected_enumerator < char > (*this);
    }

    return *i;
  }

  const char* const State::
  _xsd_State_literals_[2] =
  {
    "full",
    "partial"
  };

  const State::Value State::
  _xsd_State_indexes_[2] =
  {
    ::reginfo::State::full,
    ::reginfo::State::partial
  };

  // State1
  //

  State1::
  State1 (const ::xercesc::DOMElement& e,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f, c)
  {
    _xsd_State1_convert ();
  }

  State1::
  State1 (const ::xercesc::DOMAttr& a,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (a, f, c)
  {
    _xsd_State1_convert ();
  }

  State1::
  State1 (const ::std::string& s,
          const ::xercesc::DOMElement* e,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (s, e, f, c)
  {
    _xsd_State1_convert ();
  }

  State1* State1::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class State1 (*this, f, c);
  }

  State1::Value State1::
  _xsd_State1_convert () const
  {
    ::xsd::cxx::tree::enum_comparator< char > c (_xsd_State1_literals_);
    const Value* i (::std::lower_bound (
                      _xsd_State1_indexes_,
                      _xsd_State1_indexes_ + 3,
                      *this,
                      c));

    if (i == _xsd_State1_indexes_ + 3 || _xsd_State1_literals_[*i] != *this)
    {
      throw ::xsd::cxx::tree::unexpected_enumerator < char > (*this);
    }

    return *i;
  }

  const char* const State1::
  _xsd_State1_literals_[3] =
  {
    "init",
    "active",
    "terminated"
  };

  const State1::Value State1::
  _xsd_State1_indexes_[3] =
  {
    ::reginfo::State1::active,
    ::reginfo::State1::init,
    ::reginfo::State1::terminated
  };

  // DisplayName
  //

  DisplayName::
  DisplayName ()
  : ::flexisip::Xsd::XmlSchema::String (),
    lang_ (this)
  {
  }

  DisplayName::
  DisplayName (const char* _xsd_String_base)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    lang_ (this)
  {
  }

  DisplayName::
  DisplayName (const ::std::string& _xsd_String_base)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    lang_ (this)
  {
  }

  DisplayName::
  DisplayName (const ::flexisip::Xsd::XmlSchema::String& _xsd_String_base)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    lang_ (this)
  {
  }

  DisplayName::
  DisplayName (const DisplayName& x,
               ::flexisip::Xsd::XmlSchema::Flags f,
               ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (x, f, c),
    lang_ (x.lang_, f, this)
  {
  }

  DisplayName::
  DisplayName (const ::xercesc::DOMElement& e,
               ::flexisip::Xsd::XmlSchema::Flags f,
               ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
    lang_ (this)
  {
    if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
    {
      ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
      this->parse (p, f);
    }
  }

  void DisplayName::
  parse (::xsd::cxx::xml::dom::parser< char >& p,
         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    while (p.more_attributes ())
    {
      const ::xercesc::DOMAttr& i (p.next_attribute ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      if (n.name () == "lang" && n.namespace_ () == "http://www.w3.org/XML/1998/namespace")
      {
        this->lang_.set (LangTraits::create (i, f, this));
        continue;
      }
    }
  }

  DisplayName* DisplayName::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class DisplayName (*this, f, c);
  }

  DisplayName& DisplayName::
  operator= (const DisplayName& x)
  {
    if (this != &x)
    {
      static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = x;
      this->lang_ = x.lang_;
    }

    return *this;
  }

  DisplayName::
  ~DisplayName ()
  {
  }

  // UnknownParam
  //

  UnknownParam::
  UnknownParam (const NameType& name)
  : ::flexisip::Xsd::XmlSchema::String (),
    name_ (name, this)
  {
  }

  UnknownParam::
  UnknownParam (const char* _xsd_String_base,
                const NameType& name)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    name_ (name, this)
  {
  }

  UnknownParam::
  UnknownParam (const ::std::string& _xsd_String_base,
                const NameType& name)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    name_ (name, this)
  {
  }

  UnknownParam::
  UnknownParam (const ::flexisip::Xsd::XmlSchema::String& _xsd_String_base,
                const NameType& name)
  : ::flexisip::Xsd::XmlSchema::String (_xsd_String_base),
    name_ (name, this)
  {
  }

  UnknownParam::
  UnknownParam (const UnknownParam& x,
                ::flexisip::Xsd::XmlSchema::Flags f,
                ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (x, f, c),
    name_ (x.name_, f, this)
  {
  }

  UnknownParam::
  UnknownParam (const ::xercesc::DOMElement& e,
                ::flexisip::Xsd::XmlSchema::Flags f,
                ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
    name_ (this)
  {
    if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
    {
      ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
      this->parse (p, f);
    }
  }

  void UnknownParam::
  parse (::xsd::cxx::xml::dom::parser< char >& p,
         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    while (p.more_attributes ())
    {
      const ::xercesc::DOMAttr& i (p.next_attribute ());
      const ::xsd::cxx::xml::qualified_name< char > n (
        ::xsd::cxx::xml::dom::name< char > (i));

      if (n.name () == "name" && n.namespace_ ().empty ())
      {
        this->name_.set (NameTraits::create (i, f, this));
        continue;
      }
    }

    if (!name_.present ())
    {
      throw ::xsd::cxx::tree::expected_attribute< char > (
        "name",
        "");
    }
  }

  UnknownParam* UnknownParam::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class UnknownParam (*this, f, c);
  }

  UnknownParam& UnknownParam::
  operator= (const UnknownParam& x)
  {
    if (this != &x)
    {
      static_cast< ::flexisip::Xsd::XmlSchema::String& > (*this) = x;
      this->name_ = x.name_;
    }

    return *this;
  }

  UnknownParam::
  ~UnknownParam ()
  {
  }

  // State2
  //

  State2::
  State2 (const ::xercesc::DOMElement& e,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f, c)
  {
    _xsd_State2_convert ();
  }

  State2::
  State2 (const ::xercesc::DOMAttr& a,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (a, f, c)
  {
    _xsd_State2_convert ();
  }

  State2::
  State2 (const ::std::string& s,
          const ::xercesc::DOMElement* e,
          ::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (s, e, f, c)
  {
    _xsd_State2_convert ();
  }

  State2* State2::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class State2 (*this, f, c);
  }

  State2::Value State2::
  _xsd_State2_convert () const
  {
    ::xsd::cxx::tree::enum_comparator< char > c (_xsd_State2_literals_);
    const Value* i (::std::lower_bound (
                      _xsd_State2_indexes_,
                      _xsd_State2_indexes_ + 2,
                      *this,
                      c));

    if (i == _xsd_State2_indexes_ + 2 || _xsd_State2_literals_[*i] != *this)
    {
      throw ::xsd::cxx::tree::unexpected_enumerator < char > (*this);
    }

    return *i;
  }

  const char* const State2::
  _xsd_State2_literals_[2] =
  {
    "active",
    "terminated"
  };

  const State2::Value State2::
  _xsd_State2_indexes_[2] =
  {
    ::reginfo::State2::active,
    ::reginfo::State2::terminated
  };

  // Event
  //

  Event::
  Event (const ::xercesc::DOMElement& e,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (e, f, c)
  {
    _xsd_Event_convert ();
  }

  Event::
  Event (const ::xercesc::DOMAttr& a,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (a, f, c)
  {
    _xsd_Event_convert ();
  }

  Event::
  Event (const ::std::string& s,
         const ::xercesc::DOMElement* e,
         ::flexisip::Xsd::XmlSchema::Flags f,
         ::flexisip::Xsd::XmlSchema::Container* c)
  : ::flexisip::Xsd::XmlSchema::String (s, e, f, c)
  {
    _xsd_Event_convert ();
  }

  Event* Event::
  _clone (::flexisip::Xsd::XmlSchema::Flags f,
          ::flexisip::Xsd::XmlSchema::Container* c) const
  {
    return new class Event (*this, f, c);
  }

  Event::Value Event::
  _xsd_Event_convert () const
  {
    ::xsd::cxx::tree::enum_comparator< char > c (_xsd_Event_literals_);
    const Value* i (::std::lower_bound (
                      _xsd_Event_indexes_,
                      _xsd_Event_indexes_ + 9,
                      *this,
                      c));

    if (i == _xsd_Event_indexes_ + 9 || _xsd_Event_literals_[*i] != *this)
    {
      throw ::xsd::cxx::tree::unexpected_enumerator < char > (*this);
    }

    return *i;
  }

  const char* const Event::
  _xsd_Event_literals_[9] =
  {
    "registered",
    "created",
    "refreshed",
    "shortened",
    "expired",
    "deactivated",
    "probation",
    "unregistered",
    "rejected"
  };

  const Event::Value Event::
  _xsd_Event_indexes_[9] =
  {
    ::reginfo::Event::created,
    ::reginfo::Event::deactivated,
    ::reginfo::Event::expired,
    ::reginfo::Event::probation,
    ::reginfo::Event::refreshed,
    ::reginfo::Event::registered,
    ::reginfo::Event::rejected,
    ::reginfo::Event::shortened,
    ::reginfo::Event::unregistered
  };
}

#include <ostream>

namespace reginfo
{
  ::std::ostream&
  operator<< (::std::ostream& o, const Reginfo& i)
  {
    for (Reginfo::RegistrationConstIterator
         b (i.getRegistration ().begin ()), e (i.getRegistration ().end ());
         b != e; ++b)
    {
      o << ::std::endl << "registration: " << *b;
    }

    o << ::std::endl << "version: " << i.getVersion ();
    o << ::std::endl << "state: " << i.getState ();
    return o;
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const Registration& i)
  {
    for (Registration::ContactConstIterator
         b (i.getContact ().begin ()), e (i.getContact ().end ());
         b != e; ++b)
    {
      o << ::std::endl << "contact: " << *b;
    }

    o << ::std::endl << "aor: " << i.getAor ();
    o << ::std::endl << "id: " << i.getId ();
    o << ::std::endl << "state: " << i.getState ();
    return o;
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const Contact& i)
  {
    o << ::std::endl << "uri: " << i.getUri ();
    if (i.getDisplayName ())
    {
      o << ::std::endl << "display-name: " << *i.getDisplayName ();
    }

    for (Contact::UnknownParamConstIterator
         b (i.getUnknownParam ().begin ()), e (i.getUnknownParam ().end ());
         b != e; ++b)
    {
      o << ::std::endl << "unknown-param: " << *b;
    }

    o << ::std::endl << "state: " << i.getState ();
    o << ::std::endl << "event: " << i.getEvent ();
    if (i.getDurationRegistered ())
    {
      o << ::std::endl << "duration-registered: " << *i.getDurationRegistered ();
    }

    if (i.getExpires ())
    {
      o << ::std::endl << "expires: " << *i.getExpires ();
    }

    if (i.getRetryAfter ())
    {
      o << ::std::endl << "retry-after: " << *i.getRetryAfter ();
    }

    o << ::std::endl << "id: " << i.getId ();
    if (i.getQ ())
    {
      o << ::std::endl << "q: " << *i.getQ ();
    }

    if (i.getCallid ())
    {
      o << ::std::endl << "callid: " << *i.getCallid ();
    }

    if (i.getCseq ())
    {
      o << ::std::endl << "cseq: " << *i.getCseq ();
    }

    return o;
  }

  ::std::ostream&
  operator<< (::std::ostream& o, State::Value i)
  {
    return o << State::_xsd_State_literals_[i];
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const State& i)
  {
    return o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  ::std::ostream&
  operator<< (::std::ostream& o, State1::Value i)
  {
    return o << State1::_xsd_State1_literals_[i];
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const State1& i)
  {
    return o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const DisplayName& i)
  {
    o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);

    if (i.getLang ())
    {
      o << ::std::endl << "lang: " << *i.getLang ();
    }

    return o;
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const UnknownParam& i)
  {
    o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);

    o << ::std::endl << "name: " << i.getName ();
    return o;
  }

  ::std::ostream&
  operator<< (::std::ostream& o, State2::Value i)
  {
    return o << State2::_xsd_State2_literals_[i];
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const State2& i)
  {
    return o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  ::std::ostream&
  operator<< (::std::ostream& o, Event::Value i)
  {
    return o << Event::_xsd_Event_literals_[i];
  }

  ::std::ostream&
  operator<< (::std::ostream& o, const Event& i)
  {
    return o << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }
}

#include <istream>
#include <xsd/cxx/xml/sax/std-input-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>

namespace reginfo
{
  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (const ::std::string& u,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (const ::std::string& u,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (const ::std::string& u,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseReginfo (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseReginfo (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseReginfo (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                const ::std::string& sid,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseReginfo (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                const ::std::string& sid,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseReginfo (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::std::istream& is,
                const ::std::string& sid,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseReginfo (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::xercesc::InputSource& i,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::xercesc::InputSource& i,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::xercesc::InputSource& i,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Reginfo > (
      ::reginfo::parseReginfo (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (const ::xercesc::DOMDocument& doc,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
    {
      ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
        static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));

      return ::std::unique_ptr< ::reginfo::Reginfo > (
        ::reginfo::parseReginfo (
          std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
    }

    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "reginfo" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Reginfo > r (
        ::xsd::cxx::tree::traits< ::reginfo::Reginfo, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "reginfo",
      "urn:ietf:params:xml:ns:reginfo");
  }

  ::std::unique_ptr< ::reginfo::Reginfo >
  parseReginfo (::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties&)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > c (
      ((f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) &&
       !(f & ::flexisip::Xsd::XmlSchema::Flags::own_dom))
      ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
      : 0);

    ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());

    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
      doc.setUserData (::flexisip::Xsd::XmlSchema::dom::treeNodeKey,
                       (c.get () ? &c : &d),
                       0);

    if (n.name () == "reginfo" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Reginfo > r (
        ::xsd::cxx::tree::traits< ::reginfo::Reginfo, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "reginfo",
      "urn:ietf:params:xml:ns:reginfo");
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (const ::std::string& u,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (const ::std::string& u,
                     ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (const ::std::string& u,
                     ::xercesc::DOMErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseRegistration (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseRegistration (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     ::xercesc::DOMErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseRegistration (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     const ::std::string& sid,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseRegistration (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     const ::std::string& sid,
                     ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseRegistration (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::std::istream& is,
                     const ::std::string& sid,
                     ::xercesc::DOMErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseRegistration (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::xercesc::InputSource& i,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::xercesc::InputSource& i,
                     ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::xercesc::InputSource& i,
                     ::xercesc::DOMErrorHandler& h,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Registration > (
      ::reginfo::parseRegistration (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (const ::xercesc::DOMDocument& doc,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
    {
      ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
        static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));

      return ::std::unique_ptr< ::reginfo::Registration > (
        ::reginfo::parseRegistration (
          std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
    }

    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "registration" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Registration > r (
        ::xsd::cxx::tree::traits< ::reginfo::Registration, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "registration",
      "urn:ietf:params:xml:ns:reginfo");
  }

  ::std::unique_ptr< ::reginfo::Registration >
  parseRegistration (::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d,
                     ::flexisip::Xsd::XmlSchema::Flags f,
                     const ::flexisip::Xsd::XmlSchema::Properties&)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > c (
      ((f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) &&
       !(f & ::flexisip::Xsd::XmlSchema::Flags::own_dom))
      ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
      : 0);

    ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());

    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
      doc.setUserData (::flexisip::Xsd::XmlSchema::dom::treeNodeKey,
                       (c.get () ? &c : &d),
                       0);

    if (n.name () == "registration" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Registration > r (
        ::xsd::cxx::tree::traits< ::reginfo::Registration, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "registration",
      "urn:ietf:params:xml:ns:reginfo");
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (const ::std::string& u,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (const ::std::string& u,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (const ::std::string& u,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        u, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseContact (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseContact (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is);
    return ::reginfo::parseContact (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                const ::std::string& sid,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseContact (isrc, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                const ::std::string& sid,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0,
      (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) == 0);

    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseContact (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::std::istream& is,
                const ::std::string& sid,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
    return ::reginfo::parseContact (isrc, h, f, p);
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::xercesc::InputSource& i,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::xsd::cxx::tree::error_handler< char > h;

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::xercesc::InputSource& i,
                ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::xercesc::InputSource& i,
                ::xercesc::DOMErrorHandler& h,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::parse< char > (
        i, h, p, f));

    if (!d.get ())
      throw ::xsd::cxx::tree::parsing< char > ();

    return ::std::unique_ptr< ::reginfo::Contact > (
      ::reginfo::parseContact (
        std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (const ::xercesc::DOMDocument& doc,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties& p)
  {
    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
    {
      ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
        static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));

      return ::std::unique_ptr< ::reginfo::Contact > (
        ::reginfo::parseContact (
          std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
    }

    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "contact" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Contact > r (
        ::xsd::cxx::tree::traits< ::reginfo::Contact, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "contact",
      "urn:ietf:params:xml:ns:reginfo");
  }

  ::std::unique_ptr< ::reginfo::Contact >
  parseContact (::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d,
                ::flexisip::Xsd::XmlSchema::Flags f,
                const ::flexisip::Xsd::XmlSchema::Properties&)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > c (
      ((f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom) &&
       !(f & ::flexisip::Xsd::XmlSchema::Flags::own_dom))
      ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
      : 0);

    ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
    const ::xercesc::DOMElement& e (*doc.getDocumentElement ());

    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (f & ::flexisip::Xsd::XmlSchema::Flags::keep_dom)
      doc.setUserData (::flexisip::Xsd::XmlSchema::dom::treeNodeKey,
                       (c.get () ? &c : &d),
                       0);

    if (n.name () == "contact" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      ::std::unique_ptr< ::reginfo::Contact > r (
        ::xsd::cxx::tree::traits< ::reginfo::Contact, char >::create (
          e, f, 0));
      return r;
    }

    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "contact",
      "urn:ietf:params:xml:ns:reginfo");
  }
}

#include <ostream>
#include <xsd/cxx/tree/error-handler.hxx>
#include <xsd/cxx/xml/dom/serialization-source.hxx>

namespace reginfo
{
  void
  serializeReginfo (::std::ostream& o,
                    const ::reginfo::Reginfo& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeReginfo (::std::ostream& o,
                    const ::reginfo::Reginfo& s,
                    ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeReginfo (::std::ostream& o,
                    const ::reginfo::Reginfo& s,
                    ::xercesc::DOMErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeReginfo (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Reginfo& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeReginfo (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Reginfo& s,
                    ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeReginfo (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Reginfo& s,
                    ::xercesc::DOMErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeReginfo (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeReginfo (::xercesc::DOMDocument& d,
                    const ::reginfo::Reginfo& s,
                    ::flexisip::Xsd::XmlSchema::Flags)
  {
    ::xercesc::DOMElement& e (*d.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "reginfo" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      e << s;
    }
    else
    {
      throw ::xsd::cxx::tree::unexpected_element < char > (
        n.name (),
        n.namespace_ (),
        "reginfo",
        "urn:ietf:params:xml:ns:reginfo");
    }
  }

  ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument >
  serializeReginfo (const ::reginfo::Reginfo& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::serialize< char > (
        "reginfo",
        "urn:ietf:params:xml:ns:reginfo",
        m, f));

    ::reginfo::serializeReginfo (*d, s, f);
    return d;
  }

  void
  serializeRegistration (::std::ostream& o,
                         const ::reginfo::Registration& s,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeRegistration (::std::ostream& o,
                         const ::reginfo::Registration& s,
                         ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeRegistration (::std::ostream& o,
                         const ::reginfo::Registration& s,
                         ::xercesc::DOMErrorHandler& h,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeRegistration (::xercesc::XMLFormatTarget& t,
                         const ::reginfo::Registration& s,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeRegistration (::xercesc::XMLFormatTarget& t,
                         const ::reginfo::Registration& s,
                         ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeRegistration (::xercesc::XMLFormatTarget& t,
                         const ::reginfo::Registration& s,
                         ::xercesc::DOMErrorHandler& h,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         const ::std::string& e,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeRegistration (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeRegistration (::xercesc::DOMDocument& d,
                         const ::reginfo::Registration& s,
                         ::flexisip::Xsd::XmlSchema::Flags)
  {
    ::xercesc::DOMElement& e (*d.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "registration" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      e << s;
    }
    else
    {
      throw ::xsd::cxx::tree::unexpected_element < char > (
        n.name (),
        n.namespace_ (),
        "registration",
        "urn:ietf:params:xml:ns:reginfo");
    }
  }

  ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument >
  serializeRegistration (const ::reginfo::Registration& s,
                         const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                         ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::serialize< char > (
        "registration",
        "urn:ietf:params:xml:ns:reginfo",
        m, f));

    ::reginfo::serializeRegistration (*d, s, f);
    return d;
  }

  void
  serializeContact (::std::ostream& o,
                    const ::reginfo::Contact& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeContact (::std::ostream& o,
                    const ::reginfo::Contact& s,
                    ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::xsd::cxx::xml::auto_initializer i (
      (f & ::flexisip::Xsd::XmlSchema::Flags::dont_initialize) == 0);

    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeContact (::std::ostream& o,
                    const ::reginfo::Contact& s,
                    ::xercesc::DOMErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));
    ::xsd::cxx::xml::dom::ostream_format_target t (o);
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeContact (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Contact& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));

    ::xsd::cxx::tree::error_handler< char > h;

    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
    }
  }

  void
  serializeContact (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Contact& s,
                    ::flexisip::Xsd::XmlSchema::ErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeContact (::xercesc::XMLFormatTarget& t,
                    const ::reginfo::Contact& s,
                    ::xercesc::DOMErrorHandler& h,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    const ::std::string& e,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::reginfo::serializeContact (s, m, f));
    if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
    {
      throw ::xsd::cxx::tree::serialization< char > ();
    }
  }

  void
  serializeContact (::xercesc::DOMDocument& d,
                    const ::reginfo::Contact& s,
                    ::flexisip::Xsd::XmlSchema::Flags)
  {
    ::xercesc::DOMElement& e (*d.getDocumentElement ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (e));

    if (n.name () == "contact" &&
        n.namespace_ () == "urn:ietf:params:xml:ns:reginfo")
    {
      e << s;
    }
    else
    {
      throw ::xsd::cxx::tree::unexpected_element < char > (
        n.name (),
        n.namespace_ (),
        "contact",
        "urn:ietf:params:xml:ns:reginfo");
    }
  }

  ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument >
  serializeContact (const ::reginfo::Contact& s,
                    const ::flexisip::Xsd::XmlSchema::NamespaceInfomap& m,
                    ::flexisip::Xsd::XmlSchema::Flags f)
  {
    ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::serialize< char > (
        "contact",
        "urn:ietf:params:xml:ns:reginfo",
        m, f));

    ::reginfo::serializeContact (*d, s, f);
    return d;
  }

  void
  operator<< (::xercesc::DOMElement& e, const Reginfo& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::Type& > (i);

    // registration
    //
    for (Reginfo::RegistrationConstIterator
         b (i.getRegistration ().begin ()), n (i.getRegistration ().end ());
         b != n; ++b)
    {
      ::xercesc::DOMElement& s (
        ::xsd::cxx::xml::dom::create_element (
          "registration",
          "urn:ietf:params:xml:ns:reginfo",
          e));

      s << *b;
    }

    // any
    //
    for (Reginfo::AnyConstIterator
         b (i.getAny ().begin ()), n (i.getAny ().end ());
         b != n; ++b)
    {
      e.appendChild (
        e.getOwnerDocument ()->importNode (
          const_cast< ::xercesc::DOMElement* > (&(*b)), true));
    }

    // version
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "version",
          e));

      a << i.getVersion ();
    }

    // state
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "state",
          e));

      a << i.getState ();
    }
  }

  void
  operator<< (::xercesc::DOMElement& e, const Registration& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::Type& > (i);

    // contact
    //
    for (Registration::ContactConstIterator
         b (i.getContact ().begin ()), n (i.getContact ().end ());
         b != n; ++b)
    {
      ::xercesc::DOMElement& s (
        ::xsd::cxx::xml::dom::create_element (
          "contact",
          "urn:ietf:params:xml:ns:reginfo",
          e));

      s << *b;
    }

    // any
    //
    for (Registration::AnyConstIterator
         b (i.getAny ().begin ()), n (i.getAny ().end ());
         b != n; ++b)
    {
      e.appendChild (
        e.getOwnerDocument ()->importNode (
          const_cast< ::xercesc::DOMElement* > (&(*b)), true));
    }

    // aor
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "aor",
          e));

      a << i.getAor ();
    }

    // id
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "id",
          e));

      a << i.getId ();
    }

    // state
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "state",
          e));

      a << i.getState ();
    }
  }

  void
  operator<< (::xercesc::DOMElement& e, const Contact& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::Type& > (i);

    // uri
    //
    {
      ::xercesc::DOMElement& s (
        ::xsd::cxx::xml::dom::create_element (
          "uri",
          "urn:ietf:params:xml:ns:reginfo",
          e));

      s << i.getUri ();
    }

    // display-name
    //
    if (i.getDisplayName ())
    {
      ::xercesc::DOMElement& s (
        ::xsd::cxx::xml::dom::create_element (
          "display-name",
          "urn:ietf:params:xml:ns:reginfo",
          e));

      s << *i.getDisplayName ();
    }

    // unknown-param
    //
    for (Contact::UnknownParamConstIterator
         b (i.getUnknownParam ().begin ()), n (i.getUnknownParam ().end ());
         b != n; ++b)
    {
      ::xercesc::DOMElement& s (
        ::xsd::cxx::xml::dom::create_element (
          "unknown-param",
          "urn:ietf:params:xml:ns:reginfo",
          e));

      s << *b;
    }

    // any
    //
    for (Contact::AnyConstIterator
         b (i.getAny ().begin ()), n (i.getAny ().end ());
         b != n; ++b)
    {
      e.appendChild (
        e.getOwnerDocument ()->importNode (
          const_cast< ::xercesc::DOMElement* > (&(*b)), true));
    }

    // state
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "state",
          e));

      a << i.getState ();
    }

    // event
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "event",
          e));

      a << i.getEvent ();
    }

    // duration-registered
    //
    if (i.getDurationRegistered ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "duration-registered",
          e));

      a << *i.getDurationRegistered ();
    }

    // expires
    //
    if (i.getExpires ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "expires",
          e));

      a << *i.getExpires ();
    }

    // retry-after
    //
    if (i.getRetryAfter ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "retry-after",
          e));

      a << *i.getRetryAfter ();
    }

    // id
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "id",
          e));

      a << i.getId ();
    }

    // q
    //
    if (i.getQ ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "q",
          e));

      a << *i.getQ ();
    }

    // callid
    //
    if (i.getCallid ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "callid",
          e));

      a << *i.getCallid ();
    }

    // cseq
    //
    if (i.getCseq ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "cseq",
          e));

      a << *i.getCseq ();
    }
  }

  void
  operator<< (::xercesc::DOMElement& e, const State& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMAttr& a, const State& i)
  {
    a << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::flexisip::Xsd::XmlSchema::ListStream& l,
              const State& i)
  {
    l << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMElement& e, const State1& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMAttr& a, const State1& i)
  {
    a << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::flexisip::Xsd::XmlSchema::ListStream& l,
              const State1& i)
  {
    l << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMElement& e, const DisplayName& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);

    // lang
    //
    if (i.getLang ())
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "lang",
          "http://www.w3.org/XML/1998/namespace",
          e));

      a << *i.getLang ();
    }
  }

  void
  operator<< (::xercesc::DOMElement& e, const UnknownParam& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);

    // name
    //
    {
      ::xercesc::DOMAttr& a (
        ::xsd::cxx::xml::dom::create_attribute (
          "name",
          e));

      a << i.getName ();
    }
  }

  void
  operator<< (::xercesc::DOMElement& e, const State2& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMAttr& a, const State2& i)
  {
    a << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::flexisip::Xsd::XmlSchema::ListStream& l,
              const State2& i)
  {
    l << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMElement& e, const Event& i)
  {
    e << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::xercesc::DOMAttr& a, const Event& i)
  {
    a << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }

  void
  operator<< (::flexisip::Xsd::XmlSchema::ListStream& l,
              const Event& i)
  {
    l << static_cast< const ::flexisip::Xsd::XmlSchema::String& > (i);
  }
}

#include <xsd/cxx/post.hxx>

// Begin epilogue.
//
#if __clang__ || __GNUC__ >= 4
	#pragma GCC diagnostic pop
#endif
//
// End epilogue.

