diff --git a/src/xercesc/dom/impl/DOMAttrMapImpl.cpp b/src/xercesc/dom/impl/DOMAttrMapImpl.cpp
index 3ded9df81e5d9fc91fe5d86b9b9b677ef876688c..872a3648183e307f7421c22228354451936b5970 100644
--- a/src/xercesc/dom/impl/DOMAttrMapImpl.cpp
+++ b/src/xercesc/dom/impl/DOMAttrMapImpl.cpp
@@ -141,6 +141,35 @@ DOMNode *DOMAttrMapImpl::removeNamedItemNS(const XMLCh *namespaceURI, const XMLC
     return removed;
 }
 
+// remove the name using index
+// avoid calling findNamePoint again if the index is already known
+DOMNode * DOMAttrMapImpl::removeNamedItemAt(XMLSize_t index)
+{
+    DOMNode* removed = DOMNamedNodeMapImpl::removeNamedItemAt(index);
+
+    // Replace it if it had a default value
+    // (DOM spec level 1 - Element Interface)
+    if (hasDefaults() && (removed != 0))
+    {
+        DOMAttrMapImpl* defAttrs = ((DOMElementImpl*)fOwnerNode)->getDefaultAttributes();
+
+        const XMLCh* localName = removed->getLocalName();
+        DOMAttr* attr = 0;
+        if (localName)
+            attr = (DOMAttr*)(defAttrs->getNamedItemNS(removed->getNamespaceURI(), localName));
+        else
+            attr = (DOMAttr*)(defAttrs->getNamedItem(((DOMAttr*)removed)->getName()));
+
+        if (attr != 0)
+        {
+            DOMAttr* newAttr = (DOMAttr*)attr->cloneNode(true);
+            setNamedItem(newAttr);
+        }
+    }
+
+    return removed;
+}
+
 /**
  * Get this AttributeMap in sync with the given "defaults" map.
  * @param defaults The default attributes map to sync with.
diff --git a/src/xercesc/dom/impl/DOMAttrMapImpl.hpp b/src/xercesc/dom/impl/DOMAttrMapImpl.hpp
index 98a2eebbb9ec5b84b720712560c2105dfc23a1af..3afeae9de8a32c02cd3684ff07182c17f1f149f4 100644
--- a/src/xercesc/dom/impl/DOMAttrMapImpl.hpp
+++ b/src/xercesc/dom/impl/DOMAttrMapImpl.hpp
@@ -98,6 +98,7 @@ public:
 
     virtual DOMNode *removeNamedItem(const XMLCh *name);
     virtual DOMNode *removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName);
+    virtual DOMNode *removeNamedItemAt(XMLSize_t index);
 
     void reconcileDefaultAttributes(const DOMAttrMapImpl* defaults);
     void moveSpecifiedAttributes(DOMAttrMapImpl* srcmap);