+ return true;
+}
+
+// inserts a new node right after 'precedingNode'
+bool wxXmlNode::InsertChildAfter(wxXmlNode *child, wxXmlNode *precedingNode)
+{
+ wxCHECK_MSG( child, false, "cannot insert a NULL node!" );
+ wxCHECK_MSG( child->m_parent == NULL, false, "node already has a parent" );
+ wxCHECK_MSG( child->m_next == NULL, false, "node already has m_next" );
+ wxCHECK_MSG( precedingNode == NULL || precedingNode->m_parent == this, false,
+ "precedingNode has wrong parent" );
+
+ if ( precedingNode )
+ {
+ child->m_next = precedingNode->m_next;
+ precedingNode->m_next = child;
+ }
+ else // precedingNode == NULL
+ {
+ wxCHECK_MSG( m_children == NULL, false,
+ "NULL precedingNode only makes sense when there are no children" );
+
+ child->m_next = m_children;
+ m_children = child;
+ }
+
+ child->m_parent = this;