https://issues.shibboleth.net/jira/browse/CPPOST-71
[shibboleth/cpp-opensaml.git] / saml / saml2 / core / impl / Protocols20Impl.cpp
index ea2cb01..15c4a17 100644 (file)
@@ -1,51 +1,58 @@
-/*
- *  Copyright 2001-2006 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
  * Protocols20Impl.cpp
  * 
- * Implementation classes for SAML 2.0 Protocols schema
+ * Implementation classes for SAML 2.0 Protocols schema.
  */
 
 #include "internal.h"
 #include "exceptions.h"
-#include "saml/encryption/EncryptedKeyResolver.h"
 #include "saml2/core/Protocols.h"
+#include "signature/ContentReference.h"
 
-#include <xmltooling/AbstractChildlessElement.h>
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
-#include <xmltooling/encryption/Decrypter.h>
+#include <xmltooling/encryption/Encryption.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
+#include <xmltooling/signature/Signature.h>
+#include <xmltooling/util/DateTime.h>
 #include <xmltooling/util/XMLHelper.h>
-#include <xmltooling/validation/AbstractValidatingXMLObject.h>
 
 #include <ctime>
 #include <xercesc/util/XMLUniDefs.hpp>
 
 using namespace opensaml::saml2p;
 using namespace opensaml::saml2;
-using namespace opensaml;
 using namespace xmlsignature;
 using namespace xmlencryption;
 using namespace xmltooling;
 using namespace std;
+using xmlconstants::XMLSIG_NS;
+using xmlconstants::XMLENC_NS;
+using xmlconstants::XML_BOOL_NULL;
+using samlconstants::SAML20_NS;
+using samlconstants::SAML20P_NS;
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -62,40 +69,40 @@ namespace opensaml {
         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SessionIndex);
         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,StatusMessage);
 
+        DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RespondTo);
 
         //TODO need unit test for this, using objects from another namespace
         class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
-                                             public AbstractDOMCachingXMLObject,
-                                             public AbstractElementProxy,
-                                             public AbstractValidatingXMLObject,
-                                             public AbstractXMLObjectMarshaller,
-                                             public AbstractXMLObjectUnmarshaller
+             public AbstractComplexElement,
+             public AbstractDOMCachingXMLObject,
+             public AbstractXMLObjectMarshaller,
+             public AbstractXMLObjectUnmarshaller
         {
         public:
             virtual ~ExtensionsImpl() {}
     
-            ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
             }
                 
             ExtensionsImpl(const ExtensionsImpl& src)
-                    : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src),
-                        AbstractValidatingXMLObject(src) {
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
+                for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i) {
                     if (*i) {
-                        getXMLObjects().push_back((*i)->clone());
+                        getUnknownXMLObjects().push_back((*i)->clone());
                     }
                 }
             }
             
             IMPL_XMLOBJECT_CLONE(Extensions);
+            IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
                 // Unknown child.
                 const XMLCh* nsURI=root->getNamespaceURI();
-                if (!XMLString::equals(nsURI,SAMLConstants::SAML20P_NS) && nsURI && *nsURI) {
-                    getXMLObjects().push_back(childXMLObject);
+                if (!XMLString::equals(nsURI,SAML20P_NS) && nsURI && *nsURI) {
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
@@ -104,31 +111,30 @@ namespace opensaml {
         };
 
         class SAML_DLLLOCAL StatusCodeImpl : public virtual StatusCode,
-                                             public AbstractComplexElement,
-                                             public AbstractDOMCachingXMLObject,
-                                             public AbstractValidatingXMLObject,
-                                             public AbstractXMLObjectMarshaller,
-                                             public AbstractXMLObjectUnmarshaller
+             public AbstractComplexElement,
+             public AbstractDOMCachingXMLObject,
+             public AbstractXMLObjectMarshaller,
+             public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_Value=NULL;
-                m_StatusCode=NULL;
-                m_children.push_back(NULL);
+                m_Value=nullptr;
+                m_StatusCode=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_StatusCode=m_children.begin();
             }
+
             public:
-                virtual ~StatusCodeImpl() {}
+                virtual ~StatusCodeImpl() {
+                    XMLString::release(&m_Value);
+                }
 
-                StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-                {
-                        init();
+                StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                        : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+                    init();
                 }
 
-                StatusCodeImpl(const StatusCodeImpl& src) : AbstractXMLObject(src),
-                                                            AbstractDOMCachingXMLObject(src),
-                                                            AbstractValidatingXMLObject(src)
-                {
+                StatusCodeImpl(const StatusCodeImpl& src)
+                        : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                     init();
                     setValue(src.getValue());
                     if (src.getStatusCode())
@@ -141,90 +147,82 @@ namespace opensaml {
 
             protected:
                 void marshallAttributes(DOMElement* domElement) const {
-                    MARSHALL_STRING_ATTRIB(Value,VALUE,NULL);
+                    MARSHALL_STRING_ATTRIB(Value,VALUE,nullptr);
                 }
 
                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                    PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
+                    PROC_TYPED_CHILD(StatusCode,SAML20P_NS,false);
                     AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
                 }
 
                 void processAttribute(const DOMAttr* attribute) {
-                    PROC_STRING_ATTRIB(Value,VALUE,NULL);
+                    PROC_STRING_ATTRIB(Value,VALUE,nullptr);
                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
                 }
         };
 
         //TODO need unit tests for non-SAML namespace children
         class SAML_DLLLOCAL StatusDetailImpl : public virtual StatusDetail,
-                                               public AbstractComplexElement,
-                                               public AbstractDOMCachingXMLObject,
-                                               public AbstractValidatingXMLObject,
-                                               public AbstractXMLObjectMarshaller,
-                                               public AbstractXMLObjectUnmarshaller
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             public:
                 virtual ~StatusDetailImpl() {}
 
-                StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+                StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+                }
 
-                StatusDetailImpl(const StatusDetailImpl& src) : AbstractXMLObject(src),
-                                                                AbstractDOMCachingXMLObject(src),
-                                                                AbstractValidatingXMLObject(src)
-                {
-                        VectorOf(XMLObject) v=getDetails();
-                        for (vector<XMLObject*>::const_iterator i=src.m_Details.begin(); i!=src.m_Details.end(); i++) {
-                            if (*i) {
-                                v.push_back((*i)->clone());
-                            }
+                StatusDetailImpl(const StatusDetailImpl& src)
+                        : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
+                    for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i) {
+                        if (*i) {
+                            getUnknownXMLObjects().push_back((*i)->clone());
                         }
                     }
+                }
 
                 IMPL_XMLOBJECT_CLONE(StatusDetail);
-                IMPL_XMLOBJECT_CHILDREN(Detail,m_children.end());
+                IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
             protected:
                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                    getDetails().push_back(childXMLObject);
-                    AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                 }
         };
 
 
         class SAML_DLLLOCAL StatusImpl : public virtual Status,
-                                         public AbstractComplexElement,
-                                         public AbstractDOMCachingXMLObject,
-                                         public AbstractValidatingXMLObject,
-                                         public AbstractXMLObjectMarshaller,
-                                         public AbstractXMLObjectUnmarshaller
+             public AbstractComplexElement,
+             public AbstractDOMCachingXMLObject,
+             public AbstractXMLObjectMarshaller,
+             public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_StatusCode=NULL;
-                m_StatusMessage=NULL;
-                m_StatusDetail=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_StatusCode=nullptr;
+                m_StatusMessage=nullptr;
+                m_StatusDetail=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_StatusCode=m_children.begin();
                 m_pos_StatusMessage=m_pos_StatusCode;
                 ++m_pos_StatusMessage;
                 m_pos_StatusDetail=m_pos_StatusMessage;
                 ++m_pos_StatusDetail;
             }
+
         public:
             virtual ~StatusImpl() { }
     
-            StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
-                    init();
+            StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+                init();
             }
                 
-            StatusImpl(const StatusImpl& src) : AbstractXMLObject(src),
-                                                AbstractDOMCachingXMLObject(src),
-                                                AbstractValidatingXMLObject(src)
-            {
+            StatusImpl(const StatusImpl& src) : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
                 if (src.getStatusCode())
                     setStatusCode(src.getStatusCode()->cloneStatusCode());
@@ -240,48 +238,47 @@ namespace opensaml {
             IMPL_TYPED_CHILD(StatusDetail);
     
         protected:
-    
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(StatusMessage,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(StatusDetail,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusCode,SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusMessage,SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusDetail,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
-    
         };
 
 
-        class SAML_DLLLOCAL RequestImpl : public virtual Request,
-                                          public AbstractComplexElement,
-                                          public AbstractDOMCachingXMLObject,
-                                          public AbstractValidatingXMLObject,
-                                          public AbstractXMLObjectMarshaller,
-                                          public AbstractXMLObjectUnmarshaller
+        class SAML_DLLLOCAL RequestAbstractTypeImpl : public virtual RequestAbstractType,
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_ID=NULL;
-                m_Version=NULL;
-                m_IssueInstant=NULL;
-                m_Destination=NULL;
-                m_Consent=NULL;
-                m_Issuer=NULL;
-                m_Signature=NULL;
-                m_Extensions=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_ID=nullptr;
+                m_Version=nullptr;
+                m_IssueInstant=nullptr;
+                m_Destination=nullptr;
+                m_Consent=nullptr;
+                m_Issuer=nullptr;
+                m_Signature=nullptr;
+                m_Extensions=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_Issuer=m_children.begin();
                 m_pos_Signature=m_pos_Issuer;
                 ++m_pos_Signature;
                 m_pos_Extensions=m_pos_Signature;
                 ++m_pos_Extensions;
             }
+
         protected:
-            RequestImpl() {
+            RequestAbstractTypeImpl() {
                 init();
             }
+
         public:
-            virtual ~RequestImpl() {
+            virtual ~RequestAbstractTypeImpl() {
                 XMLString::release(&m_ID);
                 XMLString::release(&m_Version);
                 XMLString::release(&m_Destination);
@@ -289,17 +286,17 @@ namespace opensaml {
                 delete m_IssueInstant;
             }
     
-            RequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            RequestAbstractTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            RequestImpl(const RequestImpl& src) : AbstractXMLObject(src),
-                                                  AbstractDOMCachingXMLObject(src),
-                                                  AbstractValidatingXMLObject(src)
-            {
+            RequestAbstractTypeImpl(const RequestAbstractTypeImpl& src)
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
+            }
+
+            void _clone(const RequestAbstractTypeImpl& src) {
                 setID(src.getID());
                 setVersion(src.getVersion());
                 setIssueInstant(src.getIssueInstant());
@@ -313,10 +310,6 @@ namespace opensaml {
                     setExtensions(src.getExtensions()->cloneExtensions());
             }
             
-            const XMLCh* getId() const {
-                return getID();
-            }
-
             //IMPL_TYPED_CHILD(Signature);
             // Need customized setter.
         protected:
@@ -334,10 +327,13 @@ namespace opensaml {
                 if (m_Signature)
                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
             }
+
+            RequestAbstractType* cloneRequestAbstractType() const {
+                return dynamic_cast<RequestAbstractType*>(clone());
+            }
             
-            IMPL_XMLOBJECT_CLONE(Request);
             IMPL_STRING_ATTRIB(Version);
-            IMPL_STRING_ATTRIB(ID);
+            IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
             IMPL_DATETIME_ATTRIB(IssueInstant,0);
             IMPL_STRING_ATTRIB(Destination);
             IMPL_STRING_ATTRIB(Consent);
@@ -345,136 +341,142 @@ namespace opensaml {
             IMPL_TYPED_CHILD(Extensions);
     
         protected:
+            void prepareForMarshalling() const {
+                if (m_Signature)
+                    declareNonVisibleNamespaces();
+            }
+
             void marshallAttributes(DOMElement* domElement) const {
                 if (!m_Version)
-                    const_cast<RequestImpl*>(this)->m_Version=XMLString::transcode("2.0");
-                MARSHALL_STRING_ATTRIB(Version,VER,NULL);
+                    const_cast<RequestAbstractTypeImpl*>(this)->m_Version=XMLString::transcode("2.0");
+                MARSHALL_STRING_ATTRIB(Version,VER,nullptr);
                 if (!m_ID)
-                    const_cast<RequestImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
-                MARSHALL_ID_ATTRIB(ID,ID,NULL);
+                    const_cast<RequestAbstractTypeImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
+                MARSHALL_ID_ATTRIB(ID,ID,nullptr);
                 if (!m_IssueInstant) {
-                    const_cast<RequestImpl*>(this)->m_IssueInstantEpoch=time(NULL);
-                    const_cast<RequestImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
+                    const_cast<RequestAbstractTypeImpl*>(this)->m_IssueInstantEpoch=time(nullptr);
+                    const_cast<RequestAbstractTypeImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
                 }
-                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
-                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
-                MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
+                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr);
+                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,nullptr);
+                MARSHALL_STRING_ATTRIB(Consent,CONSENT,nullptr);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
-                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
             void processAttribute(const DOMAttr* attribute) {
-                PROC_ID_ATTRIB(ID,ID,NULL);
-                PROC_STRING_ATTRIB(Version,VER,NULL);
-                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
-                PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
-                PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
+                PROC_ID_ATTRIB(ID,ID,nullptr);
+                PROC_STRING_ATTRIB(Version,VER,nullptr);
+                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr);
+                PROC_STRING_ATTRIB(Destination,DESTINATION,nullptr);
+                PROC_STRING_ATTRIB(Consent,CONSENT,nullptr);
                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
             }
         };
 
 
-        class SAML_DLLLOCAL AssertionIDRequestImpl : public virtual AssertionIDRequest, public RequestImpl
+        class SAML_DLLLOCAL AssertionIDRequestImpl : public virtual AssertionIDRequest, public RequestAbstractTypeImpl
         {
         public:
             virtual ~AssertionIDRequestImpl() { }
     
-            AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
-            AssertionIDRequestImpl(const AssertionIDRequestImpl& src) : AbstractXMLObject(src),
-                                                                        RequestImpl(src)
-            {
-                VectorOf(AssertionIDRef) v=getAssertionIDRefs();
+            AssertionIDRequestImpl(const AssertionIDRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
+            }
+
+            void _clone(const AssertionIDRequestImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 for (vector<AssertionIDRef*>::const_iterator i=src.m_AssertionIDRefs.begin(); i!=src.m_AssertionIDRefs.end(); i++) {
                     if (*i) {                               
-                        v.push_back((*i)->cloneAssertionIDRef());
+                        getAssertionIDRefs().push_back((*i)->cloneAssertionIDRef());
                     }
                 }
-
             }
             
-            IMPL_XMLOBJECT_CLONE(AssertionIDRequest);
+            IMPL_XMLOBJECT_CLONE_EX(AssertionIDRequest);
             IMPL_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAMLConstants::SAML20_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAML20_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-        class SAML_DLLLOCAL SubjectQueryImpl : public virtual SubjectQuery, public RequestImpl
+        class SAML_DLLLOCAL SubjectQueryImpl : public virtual SubjectQuery, public RequestAbstractTypeImpl
         {
-            void init()
-            {
-                m_Subject = NULL;
-                m_children.push_back(NULL);
+            void init() {
+                m_Subject = nullptr;
+                m_children.push_back(nullptr);
                 m_pos_Subject = m_pos_Extensions;
                 ++m_pos_Subject;
             }
+
         protected:
             SubjectQueryImpl() {
                 init();
             }
+
         public:
             virtual ~SubjectQueryImpl() { }
     
-            SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            { 
+            SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            SubjectQueryImpl(const SubjectQueryImpl& src) : AbstractXMLObject(src),
-                                                            RequestImpl(src)
-            {
+            SubjectQueryImpl(const SubjectQueryImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
+
+            void _clone(const SubjectQueryImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 if (src.getSubject())
                     setSubject(src.getSubject()->cloneSubject());
             }
             
-            IMPL_XMLOBJECT_CLONE(SubjectQuery);
+            SubjectQuery* cloneSubjectQuery() const {
+                return dynamic_cast<SubjectQuery*>(clone());
+            }
+
             IMPL_TYPED_FOREIGN_CHILD(Subject,saml2);
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAML20_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-
         class SAML_DLLLOCAL RequestedAuthnContextImpl : public virtual RequestedAuthnContext,
-                                                        public AbstractComplexElement,
-                                                        public AbstractDOMCachingXMLObject,
-                                                        public AbstractValidatingXMLObject,
-                                                        public AbstractXMLObjectMarshaller,
-                                                        public AbstractXMLObjectUnmarshaller
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_Comparison=NULL;
+                m_Comparison=nullptr;
             }
+
         public:
             virtual ~RequestedAuthnContextImpl() {
                 XMLString::release(&m_Comparison);
             }
     
-            RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            RequestedAuthnContextImpl(const RequestedAuthnContextImpl& src) : AbstractXMLObject(src),
-                                                                              AbstractDOMCachingXMLObject(src),
-                                                                              AbstractValidatingXMLObject(src)
-            {
+            RequestedAuthnContextImpl(const RequestedAuthnContextImpl& src)
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
                 setComparison(src.getComparison());
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
@@ -501,68 +503,69 @@ namespace opensaml {
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                MARSHALL_STRING_ATTRIB(Comparison,COMPARISON,NULL);
+                MARSHALL_STRING_ATTRIB(Comparison,COMPARISON,nullptr);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAML20_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
             void processAttribute(const DOMAttr* attribute) {
-                PROC_STRING_ATTRIB(Comparison,COMPARISON,NULL);
+                PROC_STRING_ATTRIB(Comparison,COMPARISON,nullptr);
                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
             }
         };
 
-
         class SAML_DLLLOCAL AuthnQueryImpl : public virtual AuthnQuery, public SubjectQueryImpl
         {
             void init() {
-                m_SessionIndex=NULL;
-                m_RequestedAuthnContext=NULL;
-                m_children.push_back(NULL);
+                m_SessionIndex=nullptr;
+                m_RequestedAuthnContext=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_RequestedAuthnContext = m_pos_Subject;
                 ++m_pos_RequestedAuthnContext;
                 
             }
+
         public:
             virtual ~AuthnQueryImpl() {
                 XMLString::release(&m_SessionIndex);
             }
     
-            AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            AuthnQueryImpl(const AuthnQueryImpl& src) : AbstractXMLObject(src),
-                                                        SubjectQueryImpl(src)
-            {
+            AuthnQueryImpl(const AuthnQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
                 init();
+            }
+
+            void _clone(const AuthnQueryImpl& src) {
+                SubjectQueryImpl::_clone(src);
                 setSessionIndex(src.getSessionIndex());
                 if (src.getRequestedAuthnContext())
                     setRequestedAuthnContext(src.getRequestedAuthnContext()->cloneRequestedAuthnContext());
             }
             
-            IMPL_XMLOBJECT_CLONE(AuthnQuery);
+            IMPL_XMLOBJECT_CLONE_EX(AuthnQuery);
             IMPL_STRING_ATTRIB(SessionIndex);
             IMPL_TYPED_CHILD(RequestedAuthnContext);
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
+                MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,nullptr);
                 SubjectQueryImpl::marshallAttributes(domElement);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAML20P_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
-                PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
+                PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,nullptr);
                 SubjectQueryImpl::processAttribute(attribute);
             }
         };
@@ -572,12 +575,14 @@ namespace opensaml {
         public:
             virtual ~AttributeQueryImpl() { }
     
-            AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
-            AttributeQueryImpl(const AttributeQueryImpl& src) : AbstractXMLObject(src),
-                                                                SubjectQueryImpl(src)
-            {
+            AttributeQueryImpl(const AttributeQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
+            }
+
+            void _clone(const AttributeQueryImpl& src) {
+                SubjectQueryImpl::_clone(src);
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                     if (*i) {
                         Attribute* attrib=dynamic_cast<Attribute*>(*i);
@@ -587,15 +592,14 @@ namespace opensaml {
                         }
                     }
                 }
-
             }
             
-            IMPL_XMLOBJECT_CLONE(AttributeQuery);
+            IMPL_XMLOBJECT_CLONE_EX(AttributeQuery);
             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -603,28 +607,29 @@ namespace opensaml {
         class SAML_DLLLOCAL AuthzDecisionQueryImpl : public virtual AuthzDecisionQuery, public SubjectQueryImpl
         {
             void init() {
-                m_Resource=NULL;
-                m_Evidence=NULL;
-                m_children.push_back(NULL);
+                m_Resource=nullptr;
+                m_Evidence=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_Evidence=m_pos_Subject;
-                ++m_pos_Evidence;
-                
+                ++m_pos_Evidence;   
             }
+
         public:
             virtual ~AuthzDecisionQueryImpl() {
                 XMLString::release(&m_Resource);
             }
     
-            AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            AuthzDecisionQueryImpl(const AuthzDecisionQueryImpl& src) : AbstractXMLObject(src),
-                                                        SubjectQueryImpl(src)
-            {
+            AuthzDecisionQueryImpl(const AuthzDecisionQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
                 init();
+            }
+
+            void _clone(const AuthzDecisionQueryImpl& src) {
+                SubjectQueryImpl::_clone(src);
                 setResource(src.getResource());
                 if (src.getEvidence())
                     setEvidence(src.getEvidence()->cloneEvidence());
@@ -639,61 +644,57 @@ namespace opensaml {
                 }
             }
             
-            IMPL_XMLOBJECT_CLONE(AuthzDecisionQuery);
+            IMPL_XMLOBJECT_CLONE_EX(AuthzDecisionQuery);
             IMPL_STRING_ATTRIB(Resource);
             IMPL_TYPED_FOREIGN_CHILDREN(Action,saml2,m_pos_Evidence);
             IMPL_TYPED_FOREIGN_CHILD(Evidence,saml2);
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
+                MARSHALL_STRING_ATTRIB(Resource,RESOURCE,nullptr);
                 SubjectQueryImpl::marshallAttributes(domElement);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAML20_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
-                PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
+                PROC_STRING_ATTRIB(Resource,RESOURCE,nullptr);
                 SubjectQueryImpl::processAttribute(attribute);
             }
         };
 
         class SAML_DLLLOCAL NameIDPolicyImpl : public virtual NameIDPolicy,
-                                               public AbstractChildlessElement,
-                                               public AbstractDOMCachingXMLObject,
-                                               public AbstractValidatingXMLObject,
-                                               public AbstractXMLObjectMarshaller,
-                                               public AbstractXMLObjectUnmarshaller
+            public AbstractSimpleElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_Format=NULL;
-                m_SPNameQualifier=NULL;
-                m_AllowCreate=XMLConstants::XML_BOOL_NULL;
+                m_Format=nullptr;
+                m_SPNameQualifier=nullptr;
+                m_AllowCreate=XML_BOOL_NULL;
             }
+
             public:
-                virtual ~NameIDPolicyImpl()
-                {
+                virtual ~NameIDPolicyImpl() {
                     XMLString::release(&m_Format);
                     XMLString::release(&m_SPNameQualifier);
                 }
 
-                NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-                {
-                        init();
+                NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                        : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+                    init();
                 }
 
-                NameIDPolicyImpl(const NameIDPolicyImpl& src) : AbstractXMLObject(src),
-                                                                AbstractDOMCachingXMLObject(src),
-                                                                AbstractValidatingXMLObject(src)
-                {
+                NameIDPolicyImpl(const NameIDPolicyImpl& src)
+                        : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
                     init();
                     setFormat(src.getFormat());
                     setSPNameQualifier(src.getSPNameQualifier());
-                    AllowCreate(m_AllowCreate);
+                    AllowCreate(src.m_AllowCreate);
                 }
 
                 IMPL_XMLOBJECT_CLONE(NameIDPolicy);
@@ -703,49 +704,44 @@ namespace opensaml {
 
             protected:
                 void marshallAttributes(DOMElement* domElement) const {
-                    MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
-                    MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
-                    MARSHALL_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
+                    MARSHALL_STRING_ATTRIB(Format,FORMAT,nullptr);
+                    MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,nullptr);
+                    MARSHALL_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,nullptr);
                 }
 
                 void processAttribute(const DOMAttr* attribute) {
-                    PROC_STRING_ATTRIB(Format,FORMAT,NULL);
-                    PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
-                    PROC_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
+                    PROC_STRING_ATTRIB(Format,FORMAT,nullptr);
+                    PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,nullptr);
+                    PROC_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,nullptr);
                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
                 }
         };
 
         class SAML_DLLLOCAL IDPEntryImpl : public virtual IDPEntry,
-                                           public AbstractChildlessElement,
-                                           public AbstractDOMCachingXMLObject,
-                                           public AbstractValidatingXMLObject,
-                                           public AbstractXMLObjectMarshaller,
-                                           public AbstractXMLObjectUnmarshaller
+            public AbstractSimpleElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_ProviderID=NULL;
-                m_Name=NULL;
-                m_Loc=NULL;
+                m_ProviderID=nullptr;
+                m_Name=nullptr;
+                m_Loc=nullptr;
             }
+
             public:
-                virtual ~IDPEntryImpl()
-                {
+                virtual ~IDPEntryImpl() {
                     XMLString::release(&m_ProviderID);
                     XMLString::release(&m_Name);
                     XMLString::release(&m_Loc);
                 }
 
-                IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-                {
-                        init();
+                IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                        : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+                    init();
                 }
 
-                IDPEntryImpl(const IDPEntryImpl& src) : AbstractXMLObject(src),
-                                                                AbstractDOMCachingXMLObject(src),
-                                                                AbstractValidatingXMLObject(src)
-                {
+                IDPEntryImpl(const IDPEntryImpl& src) : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
                     init();
                     setProviderID(src.getProviderID());
                     setName(src.getName());
@@ -759,56 +755,47 @@ namespace opensaml {
 
             protected:
                 void marshallAttributes(DOMElement* domElement) const {
-                    MARSHALL_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
-                    MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
-                    MARSHALL_STRING_ATTRIB(Loc,LOC,NULL);
+                    MARSHALL_STRING_ATTRIB(ProviderID,PROVIDERID,nullptr);
+                    MARSHALL_STRING_ATTRIB(Name,NAME,nullptr);
+                    MARSHALL_STRING_ATTRIB(Loc,LOC,nullptr);
                 }
 
                 void processAttribute(const DOMAttr* attribute) {
-                    PROC_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
-                    PROC_STRING_ATTRIB(Name,NAME,NULL);
-                    PROC_STRING_ATTRIB(Loc,LOC,NULL);
+                    PROC_STRING_ATTRIB(ProviderID,PROVIDERID,nullptr);
+                    PROC_STRING_ATTRIB(Name,NAME,nullptr);
+                    PROC_STRING_ATTRIB(Loc,LOC,nullptr);
                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
                 }
         };
 
         class SAML_DLLLOCAL IDPListImpl : public virtual IDPList,
-                                          public AbstractComplexElement,
-                                          public AbstractDOMCachingXMLObject,
-                                          public AbstractValidatingXMLObject,
-                                          public AbstractXMLObjectMarshaller,
-                                          public AbstractXMLObjectUnmarshaller
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_GetComplete=NULL;
-                m_children.push_back(NULL);
+                m_GetComplete=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_GetComplete=m_children.begin();
-                
             }
+
         public:
             virtual ~IDPListImpl() { }
     
-            IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            IDPListImpl(const IDPListImpl& src) : AbstractXMLObject(src),
-                                                  AbstractComplexElement(src),
-                                                  AbstractDOMCachingXMLObject(src),
-                                                  AbstractValidatingXMLObject(src)
-            {
+            IDPListImpl(const IDPListImpl& src)
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
                 if (src.getGetComplete())
                     setGetComplete(src.getGetComplete()->cloneGetComplete());
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                for (vector<IDPEntry*>::const_iterator i=src.m_IDPEntrys.begin(); i!=src.m_IDPEntrys.end(); ++i) {
                     if (*i) {
-                        IDPEntry* entry=dynamic_cast<IDPEntry*>(*i);
-                        if (entry) {
-                            getIDPEntrys().push_back(entry->cloneIDPEntry());
-                            continue;
-                        }
+                        getIDPEntrys().push_back((*i)->cloneIDPEntry());
                     }
                 }
             }
@@ -819,54 +806,45 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILDREN(IDPEntry,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(GetComplete,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILDREN(IDPEntry,SAML20P_NS,false);
+                PROC_TYPED_CHILD(GetComplete,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
         };
 
 
         class SAML_DLLLOCAL ScopingImpl : public virtual Scoping,
-                                          public AbstractComplexElement,
-                                          public AbstractDOMCachingXMLObject,
-                                          public AbstractValidatingXMLObject,
-                                          public AbstractXMLObjectMarshaller,
-                                          public AbstractXMLObjectUnmarshaller
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_ProxyCount=NULL;
-                m_IDPList=NULL;
-                m_children.push_back(NULL);
+                m_ProxyCount=nullptr;
+                m_IDPList=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_IDPList=m_children.begin();
-                
             }
+
         public:
             virtual ~ScopingImpl() {
                 XMLString::release(&m_ProxyCount); 
             }
     
-            ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            ScopingImpl(const ScopingImpl& src) : AbstractXMLObject(src),
-                                                  AbstractComplexElement(src),
-                                                  AbstractDOMCachingXMLObject(src),
-                                                  AbstractValidatingXMLObject(src)
-            {
+            ScopingImpl(const ScopingImpl& src)
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
-                setProxyCount(m_ProxyCount);
+                setProxyCount(src.m_ProxyCount);
                 if (src.getIDPList())
                     setIDPList(src.getIDPList()->cloneIDPList());
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                for (vector<RequesterID*>::const_iterator i=src.m_RequesterIDs.begin(); i!=src.m_RequesterIDs.end(); ++i) {
                     if (*i) {
-                        RequesterID* reqid =dynamic_cast<RequesterID*>(*i);
-                        if (reqid) {
-                            getRequesterIDs().push_back(reqid->cloneRequesterID());
-                            continue;
-                        }
+                        getRequesterIDs().push_back((*i)->cloneRequesterID());
                     }
                 }
             }
@@ -878,42 +856,42 @@ namespace opensaml {
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                    MARSHALL_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
+                MARSHALL_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,nullptr);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(IDPList,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILDREN(RequesterID,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(IDPList,SAML20P_NS,false);
+                PROC_TYPED_CHILDREN(RequesterID,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
 
             void processAttribute(const DOMAttr* attribute) {
-                PROC_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
+                PROC_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,nullptr);
                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
             }
         };
 
-        class SAML_DLLLOCAL AuthnRequestImpl : public virtual AuthnRequest, public RequestImpl
+        class SAML_DLLLOCAL AuthnRequestImpl : public virtual AuthnRequest, public RequestAbstractTypeImpl
         {
             void init() {
-                m_ForceAuthn=XMLConstants::XML_BOOL_NULL;
-                m_IsPassive=XMLConstants::XML_BOOL_NULL;
-                m_ProtocolBinding=NULL;
-                m_AssertionConsumerServiceIndex=NULL;
-                m_AssertionConsumerServiceURL=NULL;
-                m_AttributeConsumingServiceIndex=NULL;
-                m_ProviderName=NULL;
-
-                m_Subject=NULL;
-                m_NameIDPolicy=NULL;
-                m_Conditions=NULL;
-                m_RequestedAuthnContext=NULL;
-                m_Scoping=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_ForceAuthn=XML_BOOL_NULL;
+                m_IsPassive=XML_BOOL_NULL;
+                m_ProtocolBinding=nullptr;
+                m_AssertionConsumerServiceIndex=nullptr;
+                m_AssertionConsumerServiceURL=nullptr;
+                m_AttributeConsumingServiceIndex=nullptr;
+                m_ProviderName=nullptr;
+
+                m_Subject=nullptr;
+                m_NameIDPolicy=nullptr;
+                m_Conditions=nullptr;
+                m_RequestedAuthnContext=nullptr;
+                m_Scoping=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_Subject=m_pos_Extensions;
                 ++m_pos_Subject;
                 m_pos_NameIDPolicy=m_pos_Subject;
@@ -924,8 +902,8 @@ namespace opensaml {
                 ++m_pos_RequestedAuthnContext;
                 m_pos_Scoping=m_pos_RequestedAuthnContext;
                 ++m_pos_Scoping;
-                
             }
+
         public:
             virtual ~AuthnRequestImpl() {
                 XMLString::release(&m_ProtocolBinding);
@@ -935,25 +913,24 @@ namespace opensaml {
                 XMLString::release(&m_AttributeConsumingServiceIndex);
             }
     
-            AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            AuthnRequestImpl(const AuthnRequestImpl& src) : AbstractXMLObject(src),
-                                                            RequestImpl(src)
-            {
+            AuthnRequestImpl(const AuthnRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
 
-                ForceAuthn(m_ForceAuthn);
-                IsPassive(m_IsPassive);
+            void _clone(const AuthnRequestImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
+                ForceAuthn(src.m_ForceAuthn);
+                IsPassive(src.m_IsPassive);
                 setProtocolBinding(src.getProtocolBinding());
-                setAssertionConsumerServiceIndex(m_AssertionConsumerServiceIndex);
+                setAssertionConsumerServiceIndex(src.m_AssertionConsumerServiceIndex);
                 setAssertionConsumerServiceURL(src.getAssertionConsumerServiceURL());
-                setAttributeConsumingServiceIndex(m_AttributeConsumingServiceIndex);
+                setAttributeConsumingServiceIndex(src.m_AttributeConsumingServiceIndex);
                 setProviderName(src.getProviderName());
-
                 if (src.getSubject())
                     setSubject(src.getSubject()->cloneSubject());
                 if (src.getNameIDPolicy())
@@ -966,7 +943,7 @@ namespace opensaml {
                     setScoping(src.getScoping()->cloneScoping());
             }
             
-            IMPL_XMLOBJECT_CLONE(AuthnRequest);
+            IMPL_XMLOBJECT_CLONE_EX(AuthnRequest);
 
             IMPL_BOOLEAN_ATTRIB(ForceAuthn);
             IMPL_BOOLEAN_ATTRIB(IsPassive);
@@ -984,58 +961,57 @@ namespace opensaml {
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                MARSHALL_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
-                MARSHALL_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
-                MARSHALL_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
-                MARSHALL_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
-                MARSHALL_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
-                MARSHALL_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
-                MARSHALL_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
-                RequestImpl::marshallAttributes(domElement);
+                MARSHALL_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,nullptr);
+                MARSHALL_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,nullptr);
+                MARSHALL_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,nullptr);
+                MARSHALL_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,nullptr);
+                MARSHALL_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,nullptr);
+                MARSHALL_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,nullptr);
+                MARSHALL_STRING_ATTRIB(ProviderName,PROVIDERNAME,nullptr);
+                RequestAbstractTypeImpl::marshallAttributes(domElement);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Scoping,SAMLConstants::SAML20P_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Scoping,SAML20P_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
-                PROC_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
-                PROC_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
-                PROC_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
-                PROC_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
-                PROC_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
-                PROC_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
-                PROC_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
-                RequestImpl::processAttribute(attribute);
+                PROC_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,nullptr);
+                PROC_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,nullptr);
+                PROC_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,nullptr);
+                PROC_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,nullptr);
+                PROC_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,nullptr);
+                PROC_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,nullptr);
+                PROC_STRING_ATTRIB(ProviderName,PROVIDERNAME,nullptr);
+                RequestAbstractTypeImpl::processAttribute(attribute);
             }
         };
 
-        class SAML_DLLLOCAL StatusResponseImpl : public virtual StatusResponse,
-                                                 public AbstractComplexElement,
-                                                 public AbstractDOMCachingXMLObject,
-                                                 public AbstractValidatingXMLObject,
-                                                 public AbstractXMLObjectMarshaller,
-                                                 public AbstractXMLObjectUnmarshaller
+        class SAML_DLLLOCAL StatusResponseTypeImpl : public virtual StatusResponseType,
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_ID=NULL;
-                m_InResponseTo=NULL;
-                m_Version=NULL;
-                m_IssueInstant=NULL;
-                m_Destination=NULL;
-                m_Consent=NULL;
-                m_Issuer=NULL;
-                m_Signature=NULL;
-                m_Extensions=NULL;
-                m_Status=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_ID=nullptr;
+                m_InResponseTo=nullptr;
+                m_Version=nullptr;
+                m_IssueInstant=nullptr;
+                m_Destination=nullptr;
+                m_Consent=nullptr;
+                m_Issuer=nullptr;
+                m_Signature=nullptr;
+                m_Extensions=nullptr;
+                m_Status=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_Issuer=m_children.begin();
                 m_pos_Signature=m_pos_Issuer;
                 ++m_pos_Signature;
@@ -1044,12 +1020,14 @@ namespace opensaml {
                 m_pos_Status=m_pos_Extensions;
                 ++m_pos_Status;
             }
+
         protected:
-            StatusResponseImpl() {
+            StatusResponseTypeImpl() {
                 init();
             }
+
         public:
-            virtual ~StatusResponseImpl() {
+            virtual ~StatusResponseTypeImpl() {
                 XMLString::release(&m_ID);
                 XMLString::release(&m_InResponseTo);
                 XMLString::release(&m_Version);
@@ -1058,17 +1036,17 @@ namespace opensaml {
                 delete m_IssueInstant;
             }
     
-            StatusResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            StatusResponseTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            StatusResponseImpl(const StatusResponseImpl& src) : AbstractXMLObject(src),
-                                                                AbstractDOMCachingXMLObject(src),
-                                                                AbstractValidatingXMLObject(src)
-            {
+            StatusResponseTypeImpl(const StatusResponseTypeImpl& src)
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
+            }
+
+            void _clone(const StatusResponseTypeImpl& src) {
                 setID(src.getID());
                 setInResponseTo(src.getInResponseTo());
                 setVersion(src.getVersion());
@@ -1085,10 +1063,6 @@ namespace opensaml {
                     setStatus(src.getStatus()->cloneStatus());
             }
             
-            const XMLCh* getId() const {
-                return getID();
-            }
-
             //IMPL_TYPED_CHILD(Signature);
             // Need customized setter.
         protected:
@@ -1107,9 +1081,12 @@ namespace opensaml {
                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
             }
             
-            IMPL_XMLOBJECT_CLONE(StatusResponse);
+            StatusResponseType* cloneStatusResponseType() const {
+                return dynamic_cast<StatusResponseType*>(clone());
+            }
+
             IMPL_STRING_ATTRIB(Version);
-            IMPL_STRING_ATTRIB(ID);
+            IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
             IMPL_STRING_ATTRIB(InResponseTo);
             IMPL_DATETIME_ATTRIB(IssueInstant,0);
             IMPL_STRING_ATTRIB(Destination);
@@ -1119,56 +1096,63 @@ namespace opensaml {
             IMPL_TYPED_CHILD(Status);
     
         protected:
+            void prepareForMarshalling() const {
+                if (m_Signature)
+                    declareNonVisibleNamespaces();
+            }
+
             void marshallAttributes(DOMElement* domElement) const {
                 if (!m_Version)
-                    const_cast<StatusResponseImpl*>(this)->m_Version=XMLString::transcode("2.0");
-                MARSHALL_STRING_ATTRIB(Version,VER,NULL);
+                    const_cast<StatusResponseTypeImpl*>(this)->m_Version=XMLString::transcode("2.0");
+                MARSHALL_STRING_ATTRIB(Version,VER,nullptr);
                 if (!m_ID)
-                    const_cast<StatusResponseImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
-                MARSHALL_ID_ATTRIB(ID,ID,NULL);
+                    const_cast<StatusResponseTypeImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
+                MARSHALL_ID_ATTRIB(ID,ID,nullptr);
                 if (!m_IssueInstant) {
-                    const_cast<StatusResponseImpl*>(this)->m_IssueInstantEpoch=time(NULL);
-                    const_cast<StatusResponseImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
+                    const_cast<StatusResponseTypeImpl*>(this)->m_IssueInstantEpoch=time(nullptr);
+                    const_cast<StatusResponseTypeImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
                 }
-                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
-                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
-                MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
-                MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
+                MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr);
+                MARSHALL_STRING_ATTRIB(Destination,DESTINATION,nullptr);
+                MARSHALL_STRING_ATTRIB(Consent,CONSENT,nullptr);
+                MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,nullptr);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
-                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Status,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Status,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
             void processAttribute(const DOMAttr* attribute) {
-                PROC_ID_ATTRIB(ID,ID,NULL);
-                PROC_STRING_ATTRIB(Version,VER,NULL);
-                PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
-                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
-                PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
-                PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
+                PROC_ID_ATTRIB(ID,ID,nullptr);
+                PROC_STRING_ATTRIB(Version,VER,nullptr);
+                PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,nullptr);
+                PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr);
+                PROC_STRING_ATTRIB(Destination,DESTINATION,nullptr);
+                PROC_STRING_ATTRIB(Consent,CONSENT,nullptr);
                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
             }
         };
 
-        class SAML_DLLLOCAL ResponseImpl : public virtual Response, public StatusResponseImpl
+        class SAML_DLLLOCAL ResponseImpl : public virtual Response, public StatusResponseTypeImpl
         {
         public:
             virtual ~ResponseImpl() { }
     
-            ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
-            ResponseImpl(const ResponseImpl& src) : AbstractXMLObject(src),
-                                                    StatusResponseImpl(src)
-            {
+            ResponseImpl(const ResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
+            }
+
+            void _clone(const ResponseImpl& src) {
+                StatusResponseTypeImpl::_clone(src);
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                     if (*i) {
-                        Assertion* assertion=dynamic_cast<Assertion*>(*i);
+                        saml2::Assertion* assertion=dynamic_cast<saml2::Assertion*>(*i);
                         if (assertion) {
                             getAssertions().push_back(assertion->cloneAssertion());
                             continue;
@@ -1180,196 +1164,167 @@ namespace opensaml {
                         }
                     }
                 }
-
             }
             
-            IMPL_XMLOBJECT_CLONE(Response);
+            IMPL_XMLOBJECT_CLONE_EX(Response);
             IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml2,m_children.end());
             IMPL_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAMLConstants::SAML20_NS,false);
-                StatusResponseImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAML20_NS,false);
+                StatusResponseTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-        class SAML_DLLLOCAL ArtifactResolveImpl : public virtual ArtifactResolve, public RequestImpl
+        class SAML_DLLLOCAL ArtifactResolveImpl : public virtual ArtifactResolve, public RequestAbstractTypeImpl
         {
             void init() {
-                m_Artifact=NULL;
-                m_children.push_back(NULL);
+                m_Artifact=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_Artifact=m_pos_Extensions;
                 ++m_pos_Artifact;
             }
+
         public:
             virtual ~ArtifactResolveImpl() { }
     
-            ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            { 
+            ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            ArtifactResolveImpl(const ArtifactResolveImpl& src) : AbstractXMLObject(src),
-                                                                  RequestImpl(src)
-            {
+            ArtifactResolveImpl(const ArtifactResolveImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
+
+            void _clone(const ArtifactResolveImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 if(src.getArtifact())
                     setArtifact(src.getArtifact()->cloneArtifact());
             }
             
-            IMPL_XMLOBJECT_CLONE(ArtifactResolve);
+            IMPL_XMLOBJECT_CLONE_EX(ArtifactResolve);
             IMPL_TYPED_CHILD(Artifact);
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(Artifact,SAMLConstants::SAML20P_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_CHILD(Artifact,SAML20P_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-        class SAML_DLLLOCAL ArtifactResponseImpl : public virtual ArtifactResponse, public StatusResponseImpl
+        class SAML_DLLLOCAL ArtifactResponseImpl : public virtual ArtifactResponse, public StatusResponseTypeImpl
         {
             void init() {
-                m_Payload=NULL;
-                m_children.push_back(NULL);
+                m_Payload=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_Payload=m_pos_Status;
                 ++m_pos_Payload;
             }
+
         public:
             virtual ~ArtifactResponseImpl() { }
     
-            ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            ArtifactResponseImpl(const ArtifactResponseImpl& src) : AbstractXMLObject(src),
-                                                                    StatusResponseImpl(src)
-            {
+            ArtifactResponseImpl(const ArtifactResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
                 init();
-                if (src.getPayload())
-                    setPayload(getPayload()->clone());
+            }
 
+            void _clone(const ArtifactResponseImpl& src) {
+                StatusResponseTypeImpl::_clone(src);
+                if (src.getPayload())
+                    setPayload(src.getPayload()->clone());
             }
             
-            IMPL_XMLOBJECT_CLONE(ArtifactResponse);
+            IMPL_XMLOBJECT_CLONE_EX(ArtifactResponse);
             IMPL_XMLOBJECT_CHILD(Payload);
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                // These are valid elements for the parent StatusResponse, so don't process these.
+                // These are valid elements for the parent StatusResponseType, so don't process these.
                 // If not one of these, then it must be the payload.
-                if (
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,XMLConstants::XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Status::LOCAL_NAME)
-                   )
-                {
+                if (!XMLHelper::isNodeNamed(root,SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
+                    !XMLHelper::isNodeNamed(root,XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
+                    !XMLHelper::isNodeNamed(root,SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
+                    !XMLHelper::isNodeNamed(root,SAML20P_NS,saml2p::Status::LOCAL_NAME)) {
                     setPayload(childXMLObject);
                     return;
                 }
 
-                StatusResponseImpl::processChildElement(childXMLObject,root);
+                StatusResponseTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
         class SAML_DLLLOCAL NewEncryptedIDImpl : public virtual NewEncryptedID,
-                                                 public AbstractComplexElement,
-                                                 public AbstractDOMCachingXMLObject,
-                                                 public AbstractValidatingXMLObject,
-                                                 public AbstractXMLObjectMarshaller,
-                                                 public AbstractXMLObjectUnmarshaller
+            public AbstractComplexElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             void init() {
-                m_EncryptedData=NULL;
-                m_children.push_back(NULL);
+                m_EncryptedData=nullptr;
+                m_children.push_back(nullptr);
                 m_pos_EncryptedData=m_children.begin();
             }
             
         protected:
-            NewEncryptedIDImpl()
-            {
+            NewEncryptedIDImpl() {
                 init();
             }
             
         public:
             virtual ~NewEncryptedIDImpl() {}
     
-            NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
             NewEncryptedIDImpl(const NewEncryptedIDImpl& src)
-                : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src)
-            {
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
                 init();
                 if (src.getEncryptedData())
                     setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
-                VectorOf(xmlencryption::EncryptedKey) v=getEncryptedKeys();
                 for (vector<xmlencryption::EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
                     if (*i) {
-                        v.push_back((*i)->cloneEncryptedKey());
+                        getEncryptedKeys().push_back((*i)->cloneEncryptedKey());
                     }
                 }
             }
     
-            XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
-            {
-                if (!m_EncryptedData)
-                    throw DecryptionException("No encrypted data present.");
-                Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
-                DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
-                if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
-                    DOMNode* plaintext=frag->getFirstChild();
-                    if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
-                        auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
-                        ret->releaseThisAndChildrenDOM();
-                        return ret.release();
-                    }
-                }
-                frag->release();
-                throw DecryptionException("Decryption did not result in a single element.");
-            }
-        
-            IMPL_XMLOBJECT_CLONE(NewEncryptedID);
-            EncryptedElementType* cloneEncryptedElementType() const {
-                return new NewEncryptedIDImpl(*this);
-            }
-
+            IMPL_XMLOBJECT_CLONE2(NewEncryptedID,EncryptedElementType);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
             IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
         };
 
         class SAML_DLLLOCAL TerminateImpl : public virtual Terminate,
-                                            public AbstractChildlessElement,
-                                            public AbstractDOMCachingXMLObject,
-                                            public AbstractValidatingXMLObject,
-                                            public AbstractXMLObjectMarshaller,
-                                            public AbstractXMLObjectUnmarshaller
+            public AbstractSimpleElement,
+            public AbstractDOMCachingXMLObject,
+            public AbstractXMLObjectMarshaller,
+            public AbstractXMLObjectUnmarshaller
         {
             public:
                 virtual ~TerminateImpl() { }
 
-                TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
 
-                TerminateImpl(const TerminateImpl& src) : AbstractXMLObject(src),
-                                                          AbstractDOMCachingXMLObject(src),
-                                                          AbstractValidatingXMLObject(src) { }
+                TerminateImpl(const TerminateImpl& src)
+                    : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
+                }
 
                 IMPL_XMLOBJECT_CLONE(Terminate);
 
@@ -1377,19 +1332,19 @@ namespace opensaml {
                 // has no attributes or children
         };
 
-        class SAML_DLLLOCAL ManageNameIDRequestImpl : public virtual ManageNameIDRequest, public RequestImpl
+        class SAML_DLLLOCAL ManageNameIDRequestImpl : public virtual ManageNameIDRequest, public RequestAbstractTypeImpl
         {
             void init() {
-                m_NameID=NULL;
-                m_EncryptedID=NULL;
-                m_NewID=NULL;
-                m_NewEncryptedID=NULL;
-                m_Terminate=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_NameID=nullptr;
+                m_EncryptedID=nullptr;
+                m_NewID=nullptr;
+                m_NewEncryptedID=nullptr;
+                m_Terminate=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_NameID=m_pos_Extensions;
                 ++m_pos_NameID;
                 m_pos_EncryptedID=m_pos_NameID;
@@ -1400,22 +1355,22 @@ namespace opensaml {
                 ++m_pos_NewEncryptedID;
                 m_pos_Terminate=m_pos_NewEncryptedID;
                 ++m_pos_Terminate;
-                
             }
+
         public:
             virtual ~ManageNameIDRequestImpl() { }
     
-            ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            ManageNameIDRequestImpl(const ManageNameIDRequestImpl& src) : AbstractXMLObject(src),
-                                                                            RequestImpl(src)
-            {
+            ManageNameIDRequestImpl(const ManageNameIDRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
 
+            void _clone(const ManageNameIDRequestImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 if (src.getNameID())
                     setNameID(src.getNameID()->cloneNameID());
                 if (src.getEncryptedID())
@@ -1426,11 +1381,9 @@ namespace opensaml {
                     setNewEncryptedID(src.getNewEncryptedID()->cloneNewEncryptedID());
                 if (src.getTerminate())
                     setTerminate(src.getTerminate()->cloneTerminate());
-
             }
             
-            IMPL_XMLOBJECT_CLONE(ManageNameIDRequest);
-
+            IMPL_XMLOBJECT_CLONE_EX(ManageNameIDRequest);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
             IMPL_TYPED_CHILD(NewID);
@@ -1439,69 +1392,67 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NewID,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(NewEncryptedID,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Terminate,SAMLConstants::SAML20P_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NewID,SAML20P_NS,false);
+                PROC_TYPED_CHILD(NewEncryptedID,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Terminate,SAML20P_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-        class SAML_DLLLOCAL ManageNameIDResponseImpl : public virtual ManageNameIDResponse, public StatusResponseImpl
+        class SAML_DLLLOCAL ManageNameIDResponseImpl : public virtual ManageNameIDResponse, public StatusResponseTypeImpl
         {
-            public:
-                virtual ~ManageNameIDResponseImpl() { }
-    
-                ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
-                
-                ManageNameIDResponseImpl(const ManageNameIDResponseImpl& src) : AbstractXMLObject(src),
-                                                                                StatusResponseImpl(src) { }
+        public:
+            virtual ~ManageNameIDResponseImpl() { }
 
-                IMPL_XMLOBJECT_CLONE(ManageNameIDResponse);
+            ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+            
+            ManageNameIDResponseImpl(const ManageNameIDResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
+            }
+
+            IMPL_XMLOBJECT_CLONE_EX(ManageNameIDResponse);
         };
 
-        class SAML_DLLLOCAL LogoutRequestImpl : public virtual LogoutRequest, public RequestImpl
+        class SAML_DLLLOCAL LogoutRequestImpl : public virtual LogoutRequest, public RequestAbstractTypeImpl
         {
             void init() {
-                m_Reason=NULL;
-                m_NotOnOrAfter=NULL;
-
-                m_BaseID=NULL;
-                m_NameID=NULL;
-                m_EncryptedID=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_Reason=nullptr;
+                m_NotOnOrAfter=nullptr;
+                m_BaseID=nullptr;
+                m_NameID=nullptr;
+                m_EncryptedID=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_BaseID=m_pos_Extensions;
                 ++m_pos_BaseID;
                 m_pos_NameID=m_pos_BaseID;
                 ++m_pos_NameID;
                 m_pos_EncryptedID=m_pos_NameID;
                 ++m_pos_EncryptedID;
-                
             }
+
         public:
             virtual ~LogoutRequestImpl() {
                 XMLString::release(&m_Reason);
                 delete m_NotOnOrAfter;
             }
     
-            LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            LogoutRequestImpl(const LogoutRequestImpl& src) : AbstractXMLObject(src),
-                                                              RequestImpl(src)
-            {
+            LogoutRequestImpl(const LogoutRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
 
+            void _clone(const LogoutRequestImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 setReason(src.getReason());
                 setNotOnOrAfter(src.getNotOnOrAfter());
-
                 if (src.getBaseID())
                     setBaseID(src.getBaseID()->cloneBaseID());
                 if (src.getNameID())
@@ -1509,21 +1460,16 @@ namespace opensaml {
                 if (src.getEncryptedID())
                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
 
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
+                for (vector<SessionIndex*>::const_iterator i=src.m_SessionIndexs.begin(); i!=src.m_SessionIndexs.end(); ++i) {
                     if (*i) {
-                        SessionIndex* si = dynamic_cast<SessionIndex*>(*i);
-                        if (si) {
-                            getSessionIndexs().push_back(si->cloneSessionIndex());
-                            continue;
-                        }
+                        getSessionIndexs().push_back((*i)->cloneSessionIndex());
                     }
                 }
             }
             
-            IMPL_XMLOBJECT_CLONE(LogoutRequest);
-
+            IMPL_XMLOBJECT_CLONE_EX(LogoutRequest);
             IMPL_STRING_ATTRIB(Reason);
-            IMPL_DATETIME_ATTRIB(NotOnOrAfter,LLONG_MAX);
+            IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
@@ -1531,51 +1477,51 @@ namespace opensaml {
     
         protected:
             void marshallAttributes(DOMElement* domElement) const {
-                MARSHALL_STRING_ATTRIB(Reason,REASON,NULL);
-                MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
-                RequestImpl::marshallAttributes(domElement);
+                MARSHALL_STRING_ATTRIB(Reason,REASON,nullptr);
+                MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr);
+                RequestAbstractTypeImpl::marshallAttributes(domElement);
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILDREN(SessionIndex,SAMLConstants::SAML20P_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILDREN(SessionIndex,SAML20P_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
-                PROC_STRING_ATTRIB(Reason,REASON,NULL);
-                PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
-                RequestImpl::processAttribute(attribute);
+                PROC_STRING_ATTRIB(Reason,REASON,nullptr);
+                PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr);
+                RequestAbstractTypeImpl::processAttribute(attribute);
             }
         };
 
-        class SAML_DLLLOCAL LogoutResponseImpl : public virtual LogoutResponse, public StatusResponseImpl
+        class SAML_DLLLOCAL LogoutResponseImpl : public virtual LogoutResponse, public StatusResponseTypeImpl
         {
-            public:
-                virtual ~LogoutResponseImpl() { }
-    
-                LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
-                
-                LogoutResponseImpl(const LogoutResponseImpl& src) : AbstractXMLObject(src),
-                                                                    StatusResponseImpl(src) { }
+        public:
+            virtual ~LogoutResponseImpl() { }
 
-                IMPL_XMLOBJECT_CLONE(LogoutResponse);
+            LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
+            
+            LogoutResponseImpl(const LogoutResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
+            }
+
+            IMPL_XMLOBJECT_CLONE_EX(LogoutResponse);
         };
 
 
-        class SAML_DLLLOCAL NameIDMappingRequestImpl : public virtual NameIDMappingRequest, public RequestImpl
+        class SAML_DLLLOCAL NameIDMappingRequestImpl : public virtual NameIDMappingRequest, public RequestAbstractTypeImpl
         {
             void init() {
-                m_BaseID=NULL;
-                m_NameID=NULL;
-                m_EncryptedID=NULL;
-                m_NameIDPolicy=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_BaseID=nullptr;
+                m_NameID=nullptr;
+                m_EncryptedID=nullptr;
+                m_NameIDPolicy=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_BaseID=m_pos_Extensions;
                 ++m_pos_BaseID;
                 m_pos_NameID=m_pos_BaseID;
@@ -1584,22 +1530,22 @@ namespace opensaml {
                 ++m_pos_EncryptedID;
                 m_pos_NameIDPolicy=m_pos_EncryptedID;
                 ++m_pos_NameIDPolicy;
-                
             }
+
         public:
             virtual ~NameIDMappingRequestImpl() { }
     
-            NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            NameIDMappingRequestImpl(const NameIDMappingRequestImpl& src) : AbstractXMLObject(src),
-                                                                            RequestImpl(src)
-            {
+            NameIDMappingRequestImpl(const NameIDMappingRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
                 init();
+            }
 
+            void _clone(const NameIDMappingRequestImpl& src) {
+                RequestAbstractTypeImpl::_clone(src);
                 if (src.getBaseID())
                     setBaseID(src.getBaseID()->cloneBaseID());
                 if (src.getNameID())
@@ -1608,11 +1554,9 @@ namespace opensaml {
                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
                 if (src.getNameIDPolicy())
                     setNameIDPolicy(src.getNameIDPolicy()->cloneNameIDPolicy());
-
             }
             
-            IMPL_XMLOBJECT_CLONE(NameIDMappingRequest);
-
+            IMPL_XMLOBJECT_CLONE_EX(NameIDMappingRequest);
             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
@@ -1620,56 +1564,56 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
-                RequestImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAML20P_NS,false);
+                RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
 
-        class SAML_DLLLOCAL NameIDMappingResponseImpl : public virtual NameIDMappingResponse, public StatusResponseImpl
+        class SAML_DLLLOCAL NameIDMappingResponseImpl : public virtual NameIDMappingResponse, public StatusResponseTypeImpl
         {
             void init() {
-                m_NameID=NULL;
-                m_EncryptedID=NULL;
-                m_children.push_back(NULL);
-                m_children.push_back(NULL);
+                m_NameID=nullptr;
+                m_EncryptedID=nullptr;
+                m_children.push_back(nullptr);
+                m_children.push_back(nullptr);
                 m_pos_NameID=m_pos_Status;
                 ++m_pos_NameID;
                 m_pos_EncryptedID=m_pos_NameID;
                 ++m_pos_EncryptedID;
             }
+
         public:
             virtual ~NameIDMappingResponseImpl() { }
     
-            NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
-                : AbstractXMLObject(nsURI, localName, prefix, schemaType)
-            {
+            NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+                    : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
                 
-            NameIDMappingResponseImpl(const NameIDMappingResponseImpl& src) : AbstractXMLObject(src),
-                                                                              StatusResponseImpl(src)
-            {
+            NameIDMappingResponseImpl(const NameIDMappingResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
                 init();
+            }
 
+            void _clone(const NameIDMappingResponseImpl& src) {
+                StatusResponseTypeImpl::_clone(src);
                 if (src.getNameID())
-                    setNameID(getNameID()->cloneNameID());
+                    setNameID(src.getNameID()->cloneNameID());
                 if (src.getEncryptedID())
-                    setEncryptedID(getEncryptedID()->cloneEncryptedID());
-
+                    setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
             }
             
-            IMPL_XMLOBJECT_CLONE(NameIDMappingResponse);
+            IMPL_XMLOBJECT_CLONE_EX(NameIDMappingResponse);
             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                StatusResponseImpl::processChildElement(childXMLObject,root);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                StatusResponseTypeImpl::processChildElement(childXMLObject,root);
             }
         };
     };
@@ -1710,9 +1654,9 @@ IMPL_XMLOBJECTBUILDER(Status);
 IMPL_XMLOBJECTBUILDER(StatusCode);
 IMPL_XMLOBJECTBUILDER(StatusDetail);
 IMPL_XMLOBJECTBUILDER(StatusMessage);
-IMPL_XMLOBJECTBUILDER(StatusResponse);
 IMPL_XMLOBJECTBUILDER(Terminate);
 
+IMPL_XMLOBJECTBUILDER(RespondTo);
 
 // Unicode literals
 const XMLCh Artifact::LOCAL_NAME[] = UNICODE_LITERAL_8(A,r,t,i,f,a,c,t);
@@ -1776,13 +1720,14 @@ const XMLCh RequestedAuthnContext::COMPARISON_EXACT[] = UNICODE_LITERAL_5(e,x,a,
 const XMLCh RequestedAuthnContext::COMPARISON_MINIMUM[] = UNICODE_LITERAL_7(m,i,n,i,m,u,m);
 const XMLCh RequestedAuthnContext::COMPARISON_MAXIMUM[] = UNICODE_LITERAL_7(m,a,x,i,m,u,m);
 const XMLCh RequestedAuthnContext::COMPARISON_BETTER[] = UNICODE_LITERAL_6(b,e,t,t,e,r);
-const XMLCh Request::LOCAL_NAME[] = {chNull};
-const XMLCh Request::TYPE_NAME[] = UNICODE_LITERAL_19(R,e,q,u,e,s,t,A,b,s,t,r,a,c,t,T,y,p,e);
-const XMLCh Request::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
-const XMLCh Request::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
-const XMLCh Request::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
-const XMLCh Request::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
-const XMLCh Request::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
+const XMLCh RequestAbstractType::LOCAL_NAME[] = {chNull};
+const XMLCh RequestAbstractType::TYPE_NAME[] = UNICODE_LITERAL_19(R,e,q,u,e,s,t,A,b,s,t,r,a,c,t,T,y,p,e);
+const XMLCh RequestAbstractType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
+const XMLCh RequestAbstractType::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
+const XMLCh RequestAbstractType::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
+const XMLCh RequestAbstractType::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
+const XMLCh RequestAbstractType::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
+const XMLCh RespondTo::LOCAL_NAME[] = UNICODE_LITERAL_9(R,e,s,p,o,n,d,T,o);
 const XMLCh Response::LOCAL_NAME[] = UNICODE_LITERAL_8(R,e,s,p,o,n,s,e);
 const XMLCh Response::TYPE_NAME[] = UNICODE_LITERAL_12(R,e,s,p,o,n,s,e,T,y,p,e);
 const XMLCh Scoping::LOCAL_NAME[] = UNICODE_LITERAL_7(S,c,o,p,i,n,g);
@@ -1797,15 +1742,264 @@ const XMLCh StatusCode::VALUE_ATTRIB_NAME[] = UNICODE_LITERAL_5(V,a,l,u,e);
 const XMLCh StatusDetail::LOCAL_NAME[] = UNICODE_LITERAL_12(S,t,a,t,u,s,D,e,t,a,i,l);
 const XMLCh StatusDetail::TYPE_NAME[] = UNICODE_LITERAL_16(S,t,a,t,u,s,D,e,t,a,i,l,T,y,p,e);
 const XMLCh StatusMessage::LOCAL_NAME[] = UNICODE_LITERAL_13(S,t,a,t,u,s,M,e,s,s,a,g,e);
-const XMLCh StatusResponse::LOCAL_NAME[] = {chNull};
-const XMLCh StatusResponse::TYPE_NAME[] = UNICODE_LITERAL_18(S,t,a,t,u,s,R,e,s,p,o,n,s,e,T,y,p,e);
-const XMLCh StatusResponse::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
-const XMLCh StatusResponse::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
-const XMLCh StatusResponse::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
-const XMLCh StatusResponse::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
-const XMLCh StatusResponse::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
-const XMLCh StatusResponse::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
-const XMLCh SubjectQuery::LOCAL_NAME[] = {chNull};
-const XMLCh SubjectQuery::TYPE_NAME[] = UNICODE_LITERAL_16(S,u,b,j,e,c,t,Q,u,e,r,y,T,y,p,e);
+const XMLCh StatusResponseType::LOCAL_NAME[] = {chNull};
+const XMLCh StatusResponseType::TYPE_NAME[] = UNICODE_LITERAL_18(S,t,a,t,u,s,R,e,s,p,o,n,s,e,T,y,p,e);
+const XMLCh StatusResponseType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
+const XMLCh StatusResponseType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
+const XMLCh StatusResponseType::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
+const XMLCh StatusResponseType::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
+const XMLCh StatusResponseType::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
+const XMLCh StatusResponseType::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
+const XMLCh SubjectQuery::LOCAL_NAME[] = UNICODE_LITERAL_12(S,u,b,j,e,c,t,Q,u,e,r,y);
+const XMLCh SubjectQuery::TYPE_NAME[] = UNICODE_LITERAL_24(S,u,b,j,e,c,t,Q,u,e,r,y,A,b,s,t,r,a,c,t,T,y,p,e);
 const XMLCh Terminate::LOCAL_NAME[] = UNICODE_LITERAL_9(T,e,r,m,i,n,a,t,e);
 const XMLCh Terminate::TYPE_NAME[] = UNICODE_LITERAL_13(T,e,r,m,i,n,a,t,e,T,y,p,e);
+
+// Unicode literals: LogoutRequest element, Reason attribute
+const XMLCh LogoutRequest::REASON_USER[] = // urn:oasis:names:tc:SAML:2.0:logout:user
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
+  chLatin_u, chLatin_s, chLatin_e, chLatin_r, chNull
+};
+
+const XMLCh LogoutRequest::REASON_ADMIN[] = // urn:oasis:names:tc:SAML:2.0:logout:admin
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
+  chLatin_a, chLatin_d, chLatin_m, chLatin_i, chLatin_n, chNull
+};
+
+
+const XMLCh LogoutRequest::REASON_GLOBAL_TIMEOUT[] = // urn:oasis:names:tc:SAML:2.0:logout:global-timeout
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
+  chLatin_g, chLatin_l, chLatin_o, chLatin_b, chLatin_a, chLatin_l, 
+    chDash, chLatin_t, chLatin_i, chLatin_m, chLatin_e, chLatin_o, chLatin_u, chLatin_t, chNull
+};
+
+
+const XMLCh LogoutRequest::REASON_SP_TIMEOUT[] = // urn:oasis:names:tc:SAML:2.0:logout:sp-timeout
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
+  chLatin_s, chLatin_p, chDash, chLatin_t, chLatin_i, chLatin_m, chLatin_e, chLatin_o, chLatin_u, chLatin_t, chNull
+};
+
+
+// Unicode literals, StatusCode Value
+const XMLCh StatusCode::SUCCESS[] = //  urn:oasis:names:tc:SAML:2.0:status:Success 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_S, chLatin_u, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull
+};
+
+const XMLCh StatusCode::REQUESTER[] = //  urn:oasis:names:tc:SAML:2.0:status:Requester 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_e, chLatin_r, chNull
+};
+
+const XMLCh StatusCode::RESPONDER[] = //  urn:oasis:names:tc:SAML:2.0:status:Responder 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chNull
+};
+
+const XMLCh StatusCode::VERSION_MISMATCH[] = //  urn:oasis:names:tc:SAML:2.0:status:VersionMismatch 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
+    chLatin_M, chLatin_i, chLatin_s, chLatin_m, chLatin_a, chLatin_t, chLatin_c, chLatin_h, chNull
+};
+
+const XMLCh StatusCode::AUTHN_FAILED[] = //  urn:oasis:names:tc:SAML:2.0:status:AuthnFailed 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_n,
+    chLatin_F, chLatin_a, chLatin_i, chLatin_l, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::INVALID_ATTR_NAME_OR_VALUE[] = //  urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, 
+    chLatin_A, chLatin_t, chLatin_t, chLatin_r, chLatin_N, chLatin_a, chLatin_m, chLatin_e, 
+    chLatin_O, chLatin_r, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull
+};
+
+const XMLCh StatusCode::INVALID_NAMEID_POLICY[] = //  urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, 
+   chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_I, chLatin_D, 
+   chLatin_P, chLatin_o, chLatin_l, chLatin_i, chLatin_c, chLatin_y, chNull
+};
+
+const XMLCh StatusCode::NO_AUTHN_CONTEXT[] = //  urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_N, chLatin_o, chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_n, 
+  chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull
+};
+
+const XMLCh StatusCode::NO_AVAILABLE_IDP[] = //  urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_N, chLatin_o, chLatin_A, chLatin_v, chLatin_a, chLatin_i, chLatin_l, chLatin_a, chLatin_b, chLatin_l, chLatin_e, 
+   chLatin_I, chLatin_D, chLatin_P, chNull
+};
+
+const XMLCh StatusCode::NO_PASSIVE[] = //  urn:oasis:names:tc:SAML:2.0:status:NoPassive 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_N, chLatin_o, chLatin_P, chLatin_a, chLatin_s, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull
+};
+
+const XMLCh StatusCode::NO_SUPPORTED_IDP[] = //  urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_N, chLatin_o, chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d,
+      chLatin_I, chLatin_D, chLatin_P, chNull
+};
+
+const XMLCh StatusCode::PARTIAL_LOGOUT[] = //  urn:oasis:names:tc:SAML:2.0:status:PartialLogout 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_P, chLatin_a, chLatin_r, chLatin_t, chLatin_i, chLatin_a, chLatin_l, 
+    chLatin_L, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chNull
+};
+
+const XMLCh StatusCode::PROXY_COUNT_EXCEEDED[] = //  urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_P, chLatin_r, chLatin_o, chLatin_x, chLatin_y, chLatin_C, chLatin_o, chLatin_u, chLatin_n, chLatin_t, 
+    chLatin_E, chLatin_x, chLatin_c, chLatin_e, chLatin_e, chLatin_d, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::REQUEST_DENIED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestDenied 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
+    chLatin_D, chLatin_e, chLatin_n, chLatin_i, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::REQUEST_UNSUPPORTED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
+    chLatin_U, chLatin_n, chLatin_s, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::REQUEST_VERSION_DEPRECATED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
+    chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
+    chLatin_D, chLatin_e, chLatin_p, chLatin_r, chLatin_e, chLatin_c, chLatin_a, chLatin_t, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::REQUEST_VERSION_TOO_HIGH[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
+  chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
+  chLatin_T, chLatin_o, chLatin_o, chLatin_H, chLatin_i, chLatin_g, chLatin_h, chNull
+};
+
+const XMLCh StatusCode::REQUEST_VERSION_TOO_LOW[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
+    chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
+    chLatin_T, chLatin_o, chLatin_o, chLatin_L, chLatin_o, chLatin_w, chNull
+};
+
+const XMLCh StatusCode::RESOURCE_NOT_RECOGNIZED[] = //  urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_R, chLatin_e, chLatin_s, chLatin_o, chLatin_u, chLatin_r, chLatin_c, chLatin_e, 
+    chLatin_N, chLatin_o, chLatin_t, 
+    chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_g, chLatin_n, chLatin_i, chLatin_z, chLatin_e, chLatin_d, chNull
+};
+
+const XMLCh StatusCode::TOO_MANY_RESPONSES[] = //  urn:oasis:names:tc:SAML:2.0:status:TooManyResponses 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_T, chLatin_o, chLatin_o, chLatin_M, chLatin_a, chLatin_n, chLatin_y, 
+    chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_s, chNull
+};
+
+const XMLCh StatusCode::UNKNOWN_ATTR_PROFILE[] = //  urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, 
+    chLatin_A, chLatin_t, chLatin_t, chLatin_r, 
+    chLatin_P, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chNull
+};
+
+const XMLCh StatusCode::UNKNOWN_PRINCIPAL[] = //  urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, 
+    chLatin_P, chLatin_r, chLatin_i, chLatin_n, chLatin_c, chLatin_i, chLatin_p, chLatin_a, chLatin_l, chNull
+};
+
+const XMLCh StatusCode::UNSUPPORTED_BINDING[] = //  urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding 
+{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
+  chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
+  chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
+  chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
+  chLatin_U, chLatin_n, chLatin_s, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d, 
+    chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull
+};
+