Added detach() method to strip off a root parent element, fixed bug in namespace...
[shibboleth/cpp-xmltooling.git] / xmltooling / AbstractComplexElement.cpp
index af04251..c3aa5aa 100644 (file)
@@ -30,3 +30,8 @@ using namespace xmltooling;
 AbstractComplexElement::~AbstractComplexElement() {
     std::for_each(m_children.begin(), m_children.end(), cleanup<XMLObject>());
 }
+
+void AbstractComplexElement::removeChild(XMLObject* child)
+{
+    m_children.erase(std::remove(m_children.begin(), m_children.end(), child), m_children.end());
+}