// 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 "pidf+xml.hh"

namespace flexisip
{
  namespace Xsd
  {
    namespace Pidf
    {
      // Presence
      // 

      const Presence::TupleSequence& Presence::
      getTuple () const
      {
        return this->tuple_;
      }

      Presence::TupleSequence& Presence::
      getTuple ()
      {
        return this->tuple_;
      }

      void Presence::
      setTuple (const TupleSequence& s)
      {
        this->tuple_ = s;
      }

      const Presence::NoteSequence& Presence::
      getNote () const
      {
        return this->note_;
      }

      Presence::NoteSequence& Presence::
      getNote ()
      {
        return this->note_;
      }

      void Presence::
      setNote (const NoteSequence& s)
      {
        this->note_ = s;
      }

      const Presence::PersonOptional& Presence::
      getPerson () const
      {
        return this->person_;
      }

      Presence::PersonOptional& Presence::
      getPerson ()
      {
        return this->person_;
      }

      void Presence::
      setPerson (const PersonType& x)
      {
        this->person_.set (x);
      }

      void Presence::
      setPerson (const PersonOptional& x)
      {
        this->person_ = x;
      }

      void Presence::
      setPerson (::std::unique_ptr< PersonType > x)
      {
        this->person_.set (std::move (x));
      }

      const Presence::EntityType& Presence::
      getEntity () const
      {
        return this->entity_.get ();
      }

      Presence::EntityType& Presence::
      getEntity ()
      {
        return this->entity_.get ();
      }

      void Presence::
      setEntity (const EntityType& x)
      {
        this->entity_.set (x);
      }

      void Presence::
      setEntity (::std::unique_ptr< EntityType > x)
      {
        this->entity_.set (std::move (x));
      }

      ::std::unique_ptr< Presence::EntityType > Presence::
      setDetachEntity ()
      {
        return this->entity_.detach ();
      }


      // Tuple
      // 

      const Tuple::StatusType& Tuple::
      getStatus () const
      {
        return this->status_.get ();
      }

      Tuple::StatusType& Tuple::
      getStatus ()
      {
        return this->status_.get ();
      }

      void Tuple::
      setStatus (const StatusType& x)
      {
        this->status_.set (x);
      }

      void Tuple::
      setStatus (::std::unique_ptr< StatusType > x)
      {
        this->status_.set (std::move (x));
      }

      ::std::unique_ptr< Tuple::StatusType > Tuple::
      setDetachStatus ()
      {
        return this->status_.detach ();
      }

      const Tuple::ContactOptional& Tuple::
      getContact () const
      {
        return this->contact_;
      }

      Tuple::ContactOptional& Tuple::
      getContact ()
      {
        return this->contact_;
      }

      void Tuple::
      setContact (const ContactType& x)
      {
        this->contact_.set (x);
      }

      void Tuple::
      setContact (const ContactOptional& x)
      {
        this->contact_ = x;
      }

      void Tuple::
      setContact (::std::unique_ptr< ContactType > x)
      {
        this->contact_.set (std::move (x));
      }

      const Tuple::NoteSequence& Tuple::
      getNote () const
      {
        return this->note_;
      }

      Tuple::NoteSequence& Tuple::
      getNote ()
      {
        return this->note_;
      }

      void Tuple::
      setNote (const NoteSequence& s)
      {
        this->note_ = s;
      }

      const Tuple::TimestampOptional& Tuple::
      getTimestamp () const
      {
        return this->timestamp_;
      }

      Tuple::TimestampOptional& Tuple::
      getTimestamp ()
      {
        return this->timestamp_;
      }

      void Tuple::
      setTimestamp (const TimestampType& x)
      {
        this->timestamp_.set (x);
      }

      void Tuple::
      setTimestamp (const TimestampOptional& x)
      {
        this->timestamp_ = x;
      }

      void Tuple::
      setTimestamp (::std::unique_ptr< TimestampType > x)
      {
        this->timestamp_.set (std::move (x));
      }

      const Tuple::ServiceDescriptionSequence& Tuple::
      getServiceDescription () const
      {
        return this->service_description_;
      }

      Tuple::ServiceDescriptionSequence& Tuple::
      getServiceDescription ()
      {
        return this->service_description_;
      }

      void Tuple::
      setServiceDescription (const ServiceDescriptionSequence& s)
      {
        this->service_description_ = s;
      }

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

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

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

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

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


      // Status
      // 

      const Status::BasicOptional& Status::
      getBasic () const
      {
        return this->basic_;
      }

      Status::BasicOptional& Status::
      getBasic ()
      {
        return this->basic_;
      }

      void Status::
      setBasic (const BasicType& x)
      {
        this->basic_.set (x);
      }

      void Status::
      setBasic (const BasicOptional& x)
      {
        this->basic_ = x;
      }

      void Status::
      setBasic (::std::unique_ptr< BasicType > x)
      {
        this->basic_.set (std::move (x));
      }

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

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

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

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

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


      // Basic
      // 

      Basic::
      Basic (Value v)
      : ::flexisip::Xsd::XmlSchema::String (_xsd_Basic_literals_[v])
      {
      }

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

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

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

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

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

        return *this;
      }


      // Contact
      // 

      const Contact::PriorityOptional& Contact::
      getPriority () const
      {
        return this->priority_;
      }

      Contact::PriorityOptional& Contact::
      getPriority ()
      {
        return this->priority_;
      }

      void Contact::
      setPriority (const PriorityType& x)
      {
        this->priority_.set (x);
      }

      void Contact::
      setPriority (const PriorityOptional& x)
      {
        this->priority_ = x;
      }

      void Contact::
      setPriority (::std::unique_ptr< PriorityType > x)
      {
        this->priority_.set (std::move (x));
      }


      // Note
      // 

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

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

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

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

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


      // Qvalue
      // 
    }
  }
}

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

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

namespace flexisip
{
  namespace Xsd
  {
    namespace Pidf
    {
      // Presence
      //

      Presence::
      Presence (const EntityType& entity)
      : ::flexisip::Xsd::XmlSchema::Type (),
        tuple_ (this),
        note_ (this),
        person_ (this),
        entity_ (entity, this)
      {
      }

      Presence::
      Presence (const Presence& x,
                ::flexisip::Xsd::XmlSchema::Flags f,
                ::flexisip::Xsd::XmlSchema::Container* c)
      : ::flexisip::Xsd::XmlSchema::Type (x, f, c),
        tuple_ (x.tuple_, f, this),
        note_ (x.note_, f, this),
        person_ (x.person_, f, this),
        entity_ (x.entity_, f, this)
      {
      }

      Presence::
      Presence (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),
        tuple_ (this),
        note_ (this),
        person_ (this),
        entity_ (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 Presence::
      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));

          // tuple
          //
          if (n.name () == "tuple" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< TupleType > r (
              TupleTraits::create (i, f, this));

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

          // note
          //
          if (n.name () == "note" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< NoteType > r (
              NoteTraits::create (i, f, this));

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

          // person
          //
          if (n.name () == "person" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf:data-model")
          {
            ::std::unique_ptr< PersonType > r (
              PersonTraits::create (i, f, this));

            if (!this->person_)
            {
              this->person_.set (::std::move (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 () == "entity" && n.namespace_ ().empty ())
          {
            this->entity_.set (EntityTraits::create (i, f, this));
            continue;
          }
        }

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

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

      Presence& Presence::
      operator= (const Presence& x)
      {
        if (this != &x)
        {
          static_cast< ::flexisip::Xsd::XmlSchema::Type& > (*this) = x;
          this->tuple_ = x.tuple_;
          this->note_ = x.note_;
          this->person_ = x.person_;
          this->entity_ = x.entity_;
        }

        return *this;
      }

      Presence::
      ~Presence ()
      {
      }

      // Tuple
      //

      Tuple::
      Tuple (const StatusType& status,
             const IdType& id)
      : ::flexisip::Xsd::XmlSchema::Type (),
        status_ (status, this),
        contact_ (this),
        note_ (this),
        timestamp_ (this),
        service_description_ (this),
        id_ (id, this)
      {
      }

      Tuple::
      Tuple (::std::unique_ptr< StatusType > status,
             const IdType& id)
      : ::flexisip::Xsd::XmlSchema::Type (),
        status_ (std::move (status), this),
        contact_ (this),
        note_ (this),
        timestamp_ (this),
        service_description_ (this),
        id_ (id, this)
      {
      }

      Tuple::
      Tuple (const Tuple& x,
             ::flexisip::Xsd::XmlSchema::Flags f,
             ::flexisip::Xsd::XmlSchema::Container* c)
      : ::flexisip::Xsd::XmlSchema::Type (x, f, c),
        status_ (x.status_, f, this),
        contact_ (x.contact_, f, this),
        note_ (x.note_, f, this),
        timestamp_ (x.timestamp_, f, this),
        service_description_ (x.service_description_, f, this),
        id_ (x.id_, f, this)
      {
      }

      Tuple::
      Tuple (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),
        status_ (this),
        contact_ (this),
        note_ (this),
        timestamp_ (this),
        service_description_ (this),
        id_ (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 Tuple::
      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));

          // status
          //
          if (n.name () == "status" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< StatusType > r (
              StatusTraits::create (i, f, this));

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

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

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

          // note
          //
          if (n.name () == "note" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< NoteType > r (
              NoteTraits::create (i, f, this));

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

          // timestamp
          //
          if (n.name () == "timestamp" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< TimestampType > r (
              TimestampTraits::create (i, f, this));

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

          // service-description
          //
          if (n.name () == "service-description" && n.namespace_ () == "urn:oma:xml:prs:pidf:oma-pres")
          {
            ::std::unique_ptr< ServiceDescriptionType > r (
              ServiceDescriptionTraits::create (i, f, this));

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

          break;
        }

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

        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 () == "id" && n.namespace_ ().empty ())
          {
            this->id_.set (IdTraits::create (i, f, this));
            continue;
          }
        }

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

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

      Tuple& Tuple::
      operator= (const Tuple& x)
      {
        if (this != &x)
        {
          static_cast< ::flexisip::Xsd::XmlSchema::Type& > (*this) = x;
          this->status_ = x.status_;
          this->contact_ = x.contact_;
          this->note_ = x.note_;
          this->timestamp_ = x.timestamp_;
          this->service_description_ = x.service_description_;
          this->id_ = x.id_;
        }

        return *this;
      }

      Tuple::
      ~Tuple ()
      {
      }

      // Status
      //

      Status::
      Status ()
      : ::flexisip::Xsd::XmlSchema::Type (),
        dom_document_ (::xsd::cxx::xml::dom::create_document< char > ()),
        basic_ (this),
        any_ (this->getDomDocument ())
      {
      }

      Status::
      Status (const Status& 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 > ()),
        basic_ (x.basic_, f, this),
        any_ (x.any_, this->getDomDocument ())
      {
      }

      Status::
      Status (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 > ()),
        basic_ (this),
        any_ (this->getDomDocument ())
      {
        if ((f & ::flexisip::Xsd::XmlSchema::Flags::base) == 0)
        {
          ::xsd::cxx::xml::dom::parser< char > p (e, true, false, false);
          this->parse (p, f);
        }
      }

      void Status::
      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));

          // basic
          //
          if (n.name () == "basic" && n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
          {
            ::std::unique_ptr< BasicType > r (
              BasicTraits::create (i, f, this));

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

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

          break;
        }
      }

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

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

        return *this;
      }

      Status::
      ~Status ()
      {
      }

      // Basic
      //

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

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

      Basic::
      Basic (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_Basic_convert ();
      }

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

      Basic::Value Basic::
      _xsd_Basic_convert () const
      {
        ::xsd::cxx::tree::enum_comparator< char > c (_xsd_Basic_literals_);
        const Value* i (::std::lower_bound (
                          _xsd_Basic_indexes_,
                          _xsd_Basic_indexes_ + 2,
                          *this,
                          c));

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

        return *i;
      }

      const char* const Basic::
      _xsd_Basic_literals_[2] =
      {
        "open",
        "closed"
      };

      const Basic::Value Basic::
      _xsd_Basic_indexes_[2] =
      {
        ::flexisip::Xsd::Pidf::Basic::closed,
        ::flexisip::Xsd::Pidf::Basic::open
      };

      // Contact
      //

      Contact::
      Contact (const ::flexisip::Xsd::XmlSchema::Uri& _xsd_Uri_base)
      : ::flexisip::Xsd::XmlSchema::Uri (_xsd_Uri_base),
        priority_ (this)
      {
      }

      Contact::
      Contact (const Contact& x,
               ::flexisip::Xsd::XmlSchema::Flags f,
               ::flexisip::Xsd::XmlSchema::Container* c)
      : ::flexisip::Xsd::XmlSchema::Uri (x, f, c),
        priority_ (x.priority_, f, this)
      {
      }

      Contact::
      Contact (const ::xercesc::DOMElement& e,
               ::flexisip::Xsd::XmlSchema::Flags f,
               ::flexisip::Xsd::XmlSchema::Container* c)
      : ::flexisip::Xsd::XmlSchema::Uri (e, f | ::flexisip::Xsd::XmlSchema::Flags::base, c),
        priority_ (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 Contact::
      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 () == "priority" && n.namespace_ ().empty ())
          {
            this->priority_.set (PriorityTraits::create (i, f, this));
            continue;
          }
        }
      }

      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::Uri& > (*this) = x;
          this->priority_ = x.priority_;
        }

        return *this;
      }

      Contact::
      ~Contact ()
      {
      }

      // Note
      //

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

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

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

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

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

      Note::
      Note (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 Note::
      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;
          }
        }
      }

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

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

        return *this;
      }

      Note::
      ~Note ()
      {
      }

      // Qvalue
      //

      Qvalue::
      Qvalue (const ::flexisip::Xsd::XmlSchema::Decimal& _xsd_Decimal_base)
      : ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal > (_xsd_Decimal_base)
      {
      }

      Qvalue::
      Qvalue (const Qvalue& x,
              ::flexisip::Xsd::XmlSchema::Flags f,
              ::flexisip::Xsd::XmlSchema::Container* c)
      : ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal > (x, f, c)
      {
      }

      Qvalue::
      Qvalue (const ::xercesc::DOMElement& e,
              ::flexisip::Xsd::XmlSchema::Flags f,
              ::flexisip::Xsd::XmlSchema::Container* c)
      : ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal > (e, f, c)
      {
      }

      Qvalue::
      Qvalue (const ::xercesc::DOMAttr& a,
              ::flexisip::Xsd::XmlSchema::Flags f,
              ::flexisip::Xsd::XmlSchema::Container* c)
      : ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal > (a, f, c)
      {
      }

      Qvalue::
      Qvalue (const ::std::string& s,
              const ::xercesc::DOMElement* e,
              ::flexisip::Xsd::XmlSchema::Flags f,
              ::flexisip::Xsd::XmlSchema::Container* c)
      : ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal > (s, e, f, c)
      {
      }

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

      Qvalue::
      ~Qvalue ()
      {
      }
    }
  }
}

#include <ostream>

namespace flexisip
{
  namespace Xsd
  {
    namespace Pidf
    {
      ::std::ostream&
      operator<< (::std::ostream& o, const Presence& i)
      {
        for (Presence::TupleConstIterator
             b (i.getTuple ().begin ()), e (i.getTuple ().end ());
             b != e; ++b)
        {
          o << ::std::endl << "tuple: " << *b;
        }

        for (Presence::NoteConstIterator
             b (i.getNote ().begin ()), e (i.getNote ().end ());
             b != e; ++b)
        {
          o << ::std::endl << "note: " << *b;
        }

        if (i.getPerson ())
        {
          o << ::std::endl << "person: " << *i.getPerson ();
        }

        o << ::std::endl << "entity: " << i.getEntity ();
        return o;
      }

      ::std::ostream&
      operator<< (::std::ostream& o, const Tuple& i)
      {
        o << ::std::endl << "status: " << i.getStatus ();
        if (i.getContact ())
        {
          o << ::std::endl << "contact: " << *i.getContact ();
        }

        for (Tuple::NoteConstIterator
             b (i.getNote ().begin ()), e (i.getNote ().end ());
             b != e; ++b)
        {
          o << ::std::endl << "note: " << *b;
        }

        if (i.getTimestamp ())
        {
          o << ::std::endl << "timestamp: " << *i.getTimestamp ();
        }

        for (Tuple::ServiceDescriptionConstIterator
             b (i.getServiceDescription ().begin ()), e (i.getServiceDescription ().end ());
             b != e; ++b)
        {
          o << ::std::endl << "service-description: " << *b;
        }

        o << ::std::endl << "id: " << i.getId ();
        return o;
      }

      ::std::ostream&
      operator<< (::std::ostream& o, const Status& i)
      {
        if (i.getBasic ())
        {
          o << ::std::endl << "basic: " << *i.getBasic ();
        }

        return o;
      }

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

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

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

        if (i.getPriority ())
        {
          o << ::std::endl << "priority: " << *i.getPriority ();
        }

        return o;
      }

      ::std::ostream&
      operator<< (::std::ostream& o, const Note& 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 Qvalue& i)
      {
        o << static_cast< const ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal >& > (i);

        return o;
      }
    }
  }
}

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

namespace flexisip
{
  namespace Xsd
  {
    namespace Pidf
    {
      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, h, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, h, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, h, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 ::flexisip::Xsd::Pidf::parsePresence (isrc, h, f, p);
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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< ::flexisip::Xsd::Pidf::Presence > (
          ::flexisip::Xsd::Pidf::parsePresence (
            std::move (d), f | ::flexisip::Xsd::XmlSchema::Flags::own_dom, p));
      }

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (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< ::flexisip::Xsd::Pidf::Presence > (
            ::flexisip::Xsd::Pidf::parsePresence (
              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 () == "presence" &&
            n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
        {
          ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence > r (
            ::xsd::cxx::tree::traits< ::flexisip::Xsd::Pidf::Presence, char >::create (
              e, f, 0));
          return r;
        }

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

      ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence >
      parsePresence (::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 () == "presence" &&
            n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
        {
          ::std::unique_ptr< ::flexisip::Xsd::Pidf::Presence > r (
            ::xsd::cxx::tree::traits< ::flexisip::Xsd::Pidf::Presence, char >::create (
              e, f, 0));
          return r;
        }

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

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

namespace flexisip
{
  namespace Xsd
  {
    namespace Pidf
    {
      void
      serializePresence (::std::ostream& o,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (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
      serializePresence (::std::ostream& o,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (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
      serializePresence (::std::ostream& o,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (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
      serializePresence (::xercesc::XMLFormatTarget& t,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (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
      serializePresence (::xercesc::XMLFormatTarget& t,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (s, m, f));
        if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
        {
          throw ::xsd::cxx::tree::serialization< char > ();
        }
      }

      void
      serializePresence (::xercesc::XMLFormatTarget& t,
                         const ::flexisip::Xsd::Pidf::Presence& 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 (
          ::flexisip::Xsd::Pidf::serializePresence (s, m, f));
        if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
        {
          throw ::xsd::cxx::tree::serialization< char > ();
        }
      }

      void
      serializePresence (::xercesc::DOMDocument& d,
                         const ::flexisip::Xsd::Pidf::Presence& 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 () == "presence" &&
            n.namespace_ () == "urn:ietf:params:xml:ns:pidf")
        {
          e << s;
        }
        else
        {
          throw ::xsd::cxx::tree::unexpected_element < char > (
            n.name (),
            n.namespace_ (),
            "presence",
            "urn:ietf:params:xml:ns:pidf");
        }
      }

      ::flexisip::Xsd::XmlSchema::dom::unique_ptr< ::xercesc::DOMDocument >
      serializePresence (const ::flexisip::Xsd::Pidf::Presence& 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 > (
            "presence",
            "urn:ietf:params:xml:ns:pidf",
            m, f));

        ::flexisip::Xsd::Pidf::serializePresence (*d, s, f);
        return d;
      }

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

        // tuple
        //
        for (Presence::TupleConstIterator
             b (i.getTuple ().begin ()), n (i.getTuple ().end ());
             b != n; ++b)
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "tuple",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *b;
        }

        // note
        //
        for (Presence::NoteConstIterator
             b (i.getNote ().begin ()), n (i.getNote ().end ());
             b != n; ++b)
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "note",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *b;
        }

        // person
        //
        if (i.getPerson ())
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "person",
              "urn:ietf:params:xml:ns:pidf:data-model",
              e));

          s << *i.getPerson ();
        }

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

          a << i.getEntity ();
        }
      }

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

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

          s << i.getStatus ();
        }

        // contact
        //
        if (i.getContact ())
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "contact",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *i.getContact ();
        }

        // note
        //
        for (Tuple::NoteConstIterator
             b (i.getNote ().begin ()), n (i.getNote ().end ());
             b != n; ++b)
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "note",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *b;
        }

        // timestamp
        //
        if (i.getTimestamp ())
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "timestamp",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *i.getTimestamp ();
        }

        // service-description
        //
        for (Tuple::ServiceDescriptionConstIterator
             b (i.getServiceDescription ().begin ()), n (i.getServiceDescription ().end ());
             b != n; ++b)
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "service-description",
              "urn:oma:xml:prs:pidf:oma-pres",
              e));

          s << *b;
        }

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

          a << i.getId ();
        }
      }

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

        // basic
        //
        if (i.getBasic ())
        {
          ::xercesc::DOMElement& s (
            ::xsd::cxx::xml::dom::create_element (
              "basic",
              "urn:ietf:params:xml:ns:pidf",
              e));

          s << *i.getBasic ();
        }

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

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

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

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

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

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

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

      void
      operator<< (::xercesc::DOMElement& e, const Note& 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 Qvalue& i)
      {
        e << static_cast< const ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal >& > (i);
      }

      void
      operator<< (::xercesc::DOMAttr& a, const Qvalue& i)
      {
        a << static_cast< const ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal >& > (i);
      }

      void
      operator<< (::flexisip::Xsd::XmlSchema::ListStream& l,
                  const Qvalue& i)
      {
        l << static_cast< const ::xsd::cxx::tree::fundamental_base< ::flexisip::Xsd::XmlSchema::Decimal, char, ::flexisip::Xsd::XmlSchema::SimpleType, ::xsd::cxx::tree::schema_type::decimal >& > (i);
      }
    }
  }
}

#include <xsd/cxx/post.hxx>

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

