diff --git a/src/xercesc/dom/impl/DOMDeepNodeListPool.c b/src/xercesc/dom/impl/DOMDeepNodeListPool.c
index 6038ff2b0c6d93e1acd89585572b8d97cef5bbcd..7b3521d53de12439620e89a9a4a56a1b3a10548b 100644
--- a/src/xercesc/dom/impl/DOMDeepNodeListPool.c
+++ b/src/xercesc/dom/impl/DOMDeepNodeListPool.c
@@ -71,11 +71,11 @@ DOMDeepNodeListPool<TVal, THasher>::DOMDeepNodeListPool( const XMLSize_t modulus
     fAdoptedElems(adoptElems)
     , fBucketList(0)
     , fHashModulus(modulus)
-    , fHasher(hasher)
     , fIdPtrs(0)
     , fIdPtrsCount(initSize)
     , fIdCounter(0)
     , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+    , fHasher(hasher)
 {
     initialize(modulus);
 
@@ -246,7 +246,7 @@ DOMDeepNodeListPool<TVal, THasher>::getByKey(const void* const key1, const XMLCh
 
 template <class TVal, class THasher>
 TVal*
-DOMDeepNodeListPool<TVal, THasher>::getById(const unsigned int elemId)
+DOMDeepNodeListPool<TVal, THasher>::getById(const XMLSize_t elemId)
 {
     // If its either zero or beyond our current id, its an error
     if (!elemId || (elemId > fIdCounter))
@@ -257,7 +257,7 @@ DOMDeepNodeListPool<TVal, THasher>::getById(const unsigned int elemId)
 
 template <class TVal, class THasher>
 const TVal*
-DOMDeepNodeListPool<TVal, THasher>::getById(const unsigned int elemId) const
+DOMDeepNodeListPool<TVal, THasher>::getById(const XMLSize_t elemId) const
 {
     // If its either zero or beyond our current id, its an error
     if (!elemId || (elemId > fIdCounter))
@@ -270,7 +270,7 @@ DOMDeepNodeListPool<TVal, THasher>::getById(const unsigned int elemId) const
 //  DOMDeepNodeListPool: Putters
 // ---------------------------------------------------------------------------
 template <class TVal, class THasher>
-unsigned int
+XMLSize_t
 DOMDeepNodeListPool<TVal, THasher>::put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt)
 {
     // First see if the key exists already
@@ -344,7 +344,7 @@ DOMDeepNodeListPool<TVal, THasher>::put(void* key1, XMLCh* key2, XMLCh* key3, TV
         fIdPtrs = newArray;
         fIdPtrsCount = newCount;
     }
-    const unsigned int retId = ++fIdCounter;
+    const XMLSize_t retId = ++fIdCounter;
     fIdPtrs[retId] = valueToAdopt;
 
     // Return the id that we gave to this element
diff --git a/src/xercesc/dom/impl/DOMDeepNodeListPool.hpp b/src/xercesc/dom/impl/DOMDeepNodeListPool.hpp
index 760d58b50a61a8f18193892bd41884f06f2e72e4..5eecc36e13b3cbe1e9f051a78fa3c76617bf35f9 100644
--- a/src/xercesc/dom/impl/DOMDeepNodeListPool.hpp
+++ b/src/xercesc/dom/impl/DOMDeepNodeListPool.hpp
@@ -125,13 +125,13 @@ public:
     TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3);
     const TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const;
 
-    TVal* getById(const unsigned int elemId);
-    const TVal* getById(const unsigned int elemId) const;
+    TVal* getById(const XMLSize_t elemId);
+    const TVal* getById(const XMLSize_t elemId) const;
 
     // -----------------------------------------------------------------------
     //  Putters
     // -----------------------------------------------------------------------
-    unsigned int put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt);
+    XMLSize_t put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt);
 
 private:
 
@@ -184,11 +184,11 @@ private:
     bool                                       fAdoptedElems;
     DOMDeepNodeListPoolTableBucketElem<TVal>** fBucketList;
     XMLSize_t                                  fHashModulus;
-    THasher                                    fHasher;
     TVal**                                     fIdPtrs;
     XMLSize_t                                  fIdPtrsCount;
-    unsigned int                               fIdCounter;
+    XMLSize_t                                  fIdCounter;
     MemoryManager*                             fMemoryManager;
+    THasher                                    fHasher;
 };
 
 XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/dom/impl/DOMDocumentImpl.cpp b/src/xercesc/dom/impl/DOMDocumentImpl.cpp
index 2a3f8c9975440a6f9148fbd3c2bde05418033995..4a084e327c00028deded212a0d4738be1c4c08a0 100644
--- a/src/xercesc/dom/impl/DOMDocumentImpl.cpp
+++ b/src/xercesc/dom/impl/DOMDocumentImpl.cpp
@@ -909,7 +909,7 @@ DOMNodeList *DOMDocumentImpl::getDeepNodeList(const DOMNode *rootNode, const XML
 
     DOMDeepNodeListImpl* retList = fNodeListPool->getByKey(rootNode, tagName, 0);
     if (!retList) {
-        int id = fNodeListPool->put((void*) rootNode, (XMLCh*) tagName, 0, new (this) DOMDeepNodeListImpl(rootNode, tagName));
+        XMLSize_t id = fNodeListPool->put((void*) rootNode, (XMLCh*) tagName, 0, new (this) DOMDeepNodeListImpl(rootNode, tagName));
         retList = fNodeListPool->getById(id);
     }
 
@@ -928,7 +928,7 @@ DOMNodeList *DOMDocumentImpl::getDeepNodeList(const DOMNode *rootNode,     //DOM
     DOMDeepNodeListImpl* retList = fNodeListPool->getByKey(rootNode, localName, namespaceURI);
     if (!retList) {
         // the pool will adopt the DOMDeepNodeListImpl
-        int id = fNodeListPool->put((void*) rootNode, (XMLCh*) localName, (XMLCh*) namespaceURI, new (this) DOMDeepNodeListImpl(rootNode, namespaceURI, localName));
+        XMLSize_t id = fNodeListPool->put((void*) rootNode, (XMLCh*) localName, (XMLCh*) namespaceURI, new (this) DOMDeepNodeListImpl(rootNode, namespaceURI, localName));
         retList = fNodeListPool->getById(id);
     }
 
diff --git a/src/xercesc/internal/XTemplateSerializer.cpp b/src/xercesc/internal/XTemplateSerializer.cpp
index 6efa277ed85854027f797c32844ac044e0ba2c0d..b07454cd8c05fdd3d3913c348ff37a5275f69697 100644
--- a/src/xercesc/internal/XTemplateSerializer.cpp
+++ b/src/xercesc/internal/XTemplateSerializer.cpp
@@ -2168,7 +2168,7 @@ void XTemplateSerializer::storeObject(NameIdPool<DTDElementDecl>* const objToSto
     {
         NameIdPoolEnumerator<DTDElementDecl> e(objToStore, objToStore->getMemoryManager());
 
-        serEng<<e.size();
+        serEng<<(unsigned int)e.size();
 
         while (e.hasMoreElements())
         {
@@ -2221,7 +2221,7 @@ void XTemplateSerializer::storeObject(NameIdPool<DTDEntityDecl>* const objToStor
     {
         NameIdPoolEnumerator<DTDEntityDecl> e(objToStore, objToStore->getMemoryManager());
 
-        serEng<<e.size();
+        serEng<<(unsigned int)e.size();
 
         while (e.hasMoreElements())
         {
@@ -2273,7 +2273,7 @@ void XTemplateSerializer::storeObject(NameIdPool<XMLNotationDecl>* const objToSt
     {
         NameIdPoolEnumerator<XMLNotationDecl> e(objToStore, objToStore->getMemoryManager());
 
-        serEng<<e.size();
+        serEng<<(unsigned int)e.size();
 
         while (e.hasMoreElements())
         {
diff --git a/src/xercesc/util/Hash2KeysSetOf.c b/src/xercesc/util/Hash2KeysSetOf.c
index c929100a1e86154de750b225b04a66f92fd3899a..607a8b7a8e1789bc4605b22e36ea427f7b13283e 100644
--- a/src/xercesc/util/Hash2KeysSetOf.c
+++ b/src/xercesc/util/Hash2KeysSetOf.c
@@ -62,8 +62,8 @@ Hash2KeysSetOf<THasher>::Hash2KeysSetOf(
     , fBucketList(0)
     , fHashModulus(modulus)
     , fCount(0)
-    , fHasher (hasher)
     , fAvailable(0)
+    , fHasher (hasher)
 {
     initialize(modulus);
 }
diff --git a/src/xercesc/util/Hash2KeysSetOf.hpp b/src/xercesc/util/Hash2KeysSetOf.hpp
index 29aa102e95469eeaddc5f4141fc63de03c6daef8..5fb86f430d2f5f6beccbfebd879e1d254c5ae495 100644
--- a/src/xercesc/util/Hash2KeysSetOf.hpp
+++ b/src/xercesc/util/Hash2KeysSetOf.hpp
@@ -135,8 +135,8 @@ private:
     Hash2KeysSetBucketElem**            fBucketList;
     XMLSize_t                           fHashModulus;
     XMLSize_t                           fCount;
-    THasher				                fHasher;
     Hash2KeysSetBucketElem*             fAvailable;
+    THasher				                fHasher;
 };
 
 
diff --git a/src/xercesc/util/NameIdPool.c b/src/xercesc/util/NameIdPool.c
index 0cd454ac3146bc2ddac30de524f9b85877e00da0..022d154525d17716c3df71dd33644f3549089c2b 100644
--- a/src/xercesc/util/NameIdPool.c
+++ b/src/xercesc/util/NameIdPool.c
@@ -39,14 +39,14 @@ XERCES_CPP_NAMESPACE_BEGIN
 //  NameIdPool: Constructors and Destructor
 // ---------------------------------------------------------------------------
 template <class TElem>
-NameIdPool<TElem>::NameIdPool( const unsigned int hashModulus
-                             , const unsigned int initSize
+NameIdPool<TElem>::NameIdPool( const XMLSize_t      hashModulus
+                             , const XMLSize_t      initSize
                              , MemoryManager* const manager) :
     fMemoryManager(manager)
-    , fBucketList(hashModulus, manager)
     , fIdPtrs(0)
     , fIdPtrsCount(initSize)
     , fIdCounter(0)
+    , fBucketList(hashModulus, manager)
 {
     if (!hashModulus)
         ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::Pool_ZeroModulus, fMemoryManager);
@@ -119,7 +119,7 @@ getByKey(const XMLCh* const key) const
 
 template <class TElem>
 inline TElem* NameIdPool<TElem>::
-getById(const unsigned int elemId)
+getById(const XMLSize_t elemId)
 {
     // If its either zero or beyond our current id, its an error
     if (!elemId || (elemId > fIdCounter))
@@ -130,7 +130,7 @@ getById(const unsigned int elemId)
 
 template <class TElem>
 inline const TElem* NameIdPool<TElem>::
-getById(const unsigned int elemId) const
+getById(const XMLSize_t elemId) const
 {
     // If its either zero or beyond our current id, its an error
     if (!elemId || (elemId > fIdCounter))
@@ -149,7 +149,7 @@ inline MemoryManager* NameIdPool<TElem>::getMemoryManager() const
 //  NameIdPool: Setters
 // ---------------------------------------------------------------------------
 template <class TElem>
-unsigned int NameIdPool<TElem>::put(TElem* const elemToAdopt)
+XMLSize_t NameIdPool<TElem>::put(TElem* const elemToAdopt)
 {
     // First see if the key exists already. If so, its an error
     if(containsKey(elemToAdopt->getKey()))
@@ -172,7 +172,7 @@ unsigned int NameIdPool<TElem>::put(TElem* const elemToAdopt)
     if (fIdCounter + 1 == fIdPtrsCount)
     {
         // Create a new count 1.5 times larger and allocate a new array
-        unsigned int newCount = (unsigned int)(fIdPtrsCount * 1.5);
+        XMLSize_t newCount = (XMLSize_t)(fIdPtrsCount * 1.5);
         TElem** newArray = (TElem**) fMemoryManager->allocate
         (
             newCount * sizeof(TElem*)
@@ -186,7 +186,7 @@ unsigned int NameIdPool<TElem>::put(TElem* const elemToAdopt)
         fIdPtrs = newArray;
         fIdPtrsCount = newCount;
     }
-    const unsigned int retId = ++fIdCounter;
+    const XMLSize_t retId = ++fIdCounter;
     fIdPtrs[retId] = elemToAdopt;
 
     // Set the id on the passed element
@@ -276,7 +276,7 @@ template <class TElem> void NameIdPoolEnumerator<TElem>::Reset()
     fCurIndex = fToEnum->fIdCounter ? 1:0;
 }
 
-template <class TElem> unsigned int NameIdPoolEnumerator<TElem>::size() const
+template <class TElem> XMLSize_t NameIdPoolEnumerator<TElem>::size() const
 {
     return fToEnum->fIdCounter;
 }
diff --git a/src/xercesc/util/NameIdPool.hpp b/src/xercesc/util/NameIdPool.hpp
index e818487f8061e04893e89799494de140ab23fd00..bb62e8c82cc239d514e89094cba0199c556a3776 100644
--- a/src/xercesc/util/NameIdPool.hpp
+++ b/src/xercesc/util/NameIdPool.hpp
@@ -67,8 +67,8 @@ public :
     // -----------------------------------------------------------------------
     NameIdPool
     (
-        const   unsigned int    hashModulus
-        , const unsigned int    initSize = 128
+        const   XMLSize_t       hashModulus
+        , const XMLSize_t       initSize = 128
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 
@@ -87,8 +87,8 @@ public :
     // -----------------------------------------------------------------------
     TElem* getByKey(const XMLCh* const key);
     const TElem* getByKey(const XMLCh* const key) const;
-    TElem* getById(const unsigned int elemId);
-    const TElem* getById(const unsigned int elemId) const;
+    TElem* getById(const XMLSize_t elemId);
+    const TElem* getById(const XMLSize_t elemId) const;
 
     MemoryManager* getMemoryManager() const;
     // -----------------------------------------------------------------------
@@ -97,7 +97,7 @@ public :
     //  Dups are not allowed and cause an IllegalArgumentException. The id
     //  of the new element is returned.
     // -----------------------------------------------------------------------
-    unsigned int put(TElem* const valueToAdopt);
+    XMLSize_t put(TElem* const valueToAdopt);
 
 
 protected :
@@ -136,10 +136,10 @@ private :
     //
     // -----------------------------------------------------------------------
     MemoryManager*                  fMemoryManager;
-    RefHashTableOf<TElem>           fBucketList;
     TElem**                         fIdPtrs;
-    unsigned int                    fIdPtrsCount;
-    unsigned int                    fIdCounter;
+    XMLSize_t                       fIdPtrsCount;
+    XMLSize_t                       fIdCounter;
+    RefHashTableOf<TElem>           fBucketList;
 };
 
 
@@ -180,7 +180,7 @@ public :
     bool hasMoreElements() const;
     TElem& nextElement();
     void Reset();
-    unsigned int  size()  const;
+    XMLSize_t size()  const;
 
 private :
     // -----------------------------------------------------------------------
@@ -193,7 +193,7 @@ private :
     //  fToEnum
     //      The name id pool that is being enumerated.
     // -----------------------------------------------------------------------
-    unsigned int            fCurIndex;
+    XMLSize_t               fCurIndex;
     NameIdPool<TElem>*      fToEnum;
     MemoryManager*          fMemoryManager;
 };
diff --git a/src/xercesc/util/RefHash2KeysTableOf.hpp b/src/xercesc/util/RefHash2KeysTableOf.hpp
index d808abb8ba3f1d1b3704d06f57cf75b6debd64fc..d2639e8cc7070b86e56c279ebd08befbc9ae8697 100644
--- a/src/xercesc/util/RefHash2KeysTableOf.hpp
+++ b/src/xercesc/util/RefHash2KeysTableOf.hpp
@@ -170,7 +170,7 @@ private:
     RefHash2KeysTableBucketElem<TVal>** fBucketList;
     XMLSize_t                           fHashModulus;
     XMLSize_t                           fCount;
-    THasher				fHasher;
+    THasher                             fHasher;
 };
 
 
diff --git a/src/xercesc/util/RefHash3KeysIdPool.c b/src/xercesc/util/RefHash3KeysIdPool.c
index ddcba863ab81dbad016be787f518fb3b06997599..4fdd595244036787d5127e836873bf2bf0338e4d 100644
--- a/src/xercesc/util/RefHash3KeysIdPool.c
+++ b/src/xercesc/util/RefHash3KeysIdPool.c
@@ -73,10 +73,10 @@ RefHash3KeysIdPool<TVal, THasher>::RefHash3KeysIdPool(
     , fAdoptedElems(true)
     , fBucketList(0)
     , fHashModulus(modulus)
-    , fHasher(hasher)
     , fIdPtrs(0)
     , fIdPtrsCount(initSize)
     , fIdCounter(0)
+    , fHasher(hasher)
 {
     initialize(modulus);
 
@@ -130,10 +130,10 @@ RefHash3KeysIdPool<TVal, THasher>::RefHash3KeysIdPool(
     , fAdoptedElems(adoptElems)
     , fBucketList(0)
     , fHashModulus(modulus)
-    , fHasher(hasher)
     , fIdPtrs(0)
     , fIdPtrsCount(initSize)
     , fIdCounter(0)
+    , fHasher(hasher)
 {
     initialize(modulus);
 
diff --git a/src/xercesc/util/RefHash3KeysIdPool.hpp b/src/xercesc/util/RefHash3KeysIdPool.hpp
index e1dd5b82cc4f6316b5d06e80a06105b6a74852fb..666abebfc2d7d595b68455724550c39386b05187 100644
--- a/src/xercesc/util/RefHash3KeysIdPool.hpp
+++ b/src/xercesc/util/RefHash3KeysIdPool.hpp
@@ -196,10 +196,10 @@ private:
     bool                                fAdoptedElems;
     RefHash3KeysTableBucketElem<TVal>** fBucketList;
     XMLSize_t                           fHashModulus;
-    THasher                             fHasher;
     TVal**                              fIdPtrs;
     XMLSize_t                           fIdPtrsCount;
     XMLSize_t                           fIdCounter;
+    THasher                             fHasher;
 };
 
 
diff --git a/src/xercesc/validators/DTD/DTDGrammar.hpp b/src/xercesc/validators/DTD/DTDGrammar.hpp
index f87c49a4a1fda9e7bb767aee317a28087582e606..391613e019b4e7bcb2afa3a32c132b233e855a35 100644
--- a/src/xercesc/validators/DTD/DTDGrammar.hpp
+++ b/src/xercesc/validators/DTD/DTDGrammar.hpp
@@ -163,7 +163,7 @@ public:
     // -----------------------------------------------------------------------
     //  Content management methods
     // -----------------------------------------------------------------------
-    unsigned int putEntityDecl(DTDEntityDecl* const entityDecl) const;
+    XMLSize_t putEntityDecl(DTDEntityDecl* const entityDecl) const;
 
     /***
      * Support for Serialization/De-serialization
@@ -275,7 +275,7 @@ inline const NameIdPool<DTDEntityDecl>* DTDGrammar::getEntityDeclPool() const
 // -----------------------------------------------------------------------
 //  Setter methods
 // -----------------------------------------------------------------------
-inline unsigned int DTDGrammar::putEntityDecl(DTDEntityDecl* const entityDecl)   const
+inline XMLSize_t DTDGrammar::putEntityDecl(DTDEntityDecl* const entityDecl)   const
 {
     return fEntityDeclPool->put(entityDecl);
 }