+ for_each(m_children.begin(), m_children.end(), cleanup<XMLObject>());
+ for (vector<XMLCh*>::iterator i=m_text.begin(); i!=m_text.end(); ++i)
+ XMLString::release(&(*i));
+}
+
+bool AbstractComplexElement::hasChildren() const
+{
+ if (m_children.empty())
+ return false;
+ return (find_if(m_children.begin(), m_children.end(), _nonnull) != m_children.end());
+}
+
+const list<XMLObject*>& AbstractComplexElement::getOrderedChildren() const
+{
+ return m_children;
+}
+
+void AbstractComplexElement::removeChild(XMLObject* child)
+{
+ m_children.erase(remove(m_children.begin(), m_children.end(), child), m_children.end());
+}
+
+const XMLCh* AbstractComplexElement::getTextContent(unsigned int position) const
+{
+ return (m_text.size() > position) ? m_text[position] : nullptr;
+}
+
+void AbstractComplexElement::setTextContent(const XMLCh* value, unsigned int position)
+{
+ if (position > m_children.size())
+ throw XMLObjectException("Can't set text content relative to non-existent child position.");
+ vector<XMLCh*>::size_type size = m_text.size();
+ while (position >= size) {
+ m_text.push_back(nullptr);
+ ++size;
+ }
+ m_text[position]=prepareForAssignment(m_text[position],value);