------------------------------------------------------------ The function that is giving the trouble. It returns a tm_list (just a linked list) of messages, which is my class that contains an xmlDoc. 01 tm_list* message::get_child_messages(char *format_str) 02 { 03 tm_list *answer = new tm_list(); 04 xmlChar* fmt; 05 06 for ( xmlNodePtr node = xmlDocGetRootElement(xml_doc_tree)->childs; 07 node != NULL; 08 node = node->next ) 09 { 10 // this line looks for a "format" attribute. if it is an item, 11 // this is null, if this is a message, we have set the format for 12 // this node 13 fmt = xmlGetProp(node, get_format_xmlCharPtr()); 14 15 // if no format_str was passed in, always add it 16 // OR if it is a message of the correct format, add it 17 if (format_str == NULL || (fmt && 0 == msg_xml_strcmp(fmt, format_str))) 18 { 19 20 // make it into a message 21 message *node_msg = new message(node); 22 23 // add it to the list 24 answer->add(node_msg); 25 } 26 delete fmt; 27 } 28 return answer; 29 } ------------------------------------------------------------ This is the constructor in line 21: 01 message::message(const xmlNodePtr node) 02 { 03 parent_link = node; // a self referencing link 04 xmlNodePtr node_copy = xmlCopyNode(node, 1); 05 msg_set_vars(); // sets class variables 06 xml_doc_tree = xmlNewDoc((xmlChar*)"1.0"); 07 xmlDocSetRootElement(xml_doc_tree,node_copy); 08 } ------------------------------------------------------------ The message class contains an xml document. The format is exemplified by this example: 40 GDK Free Software Management Software Project 1 This is a demo project that reflects the Team GDK Project implmentation cycle Karim Nassar 2 David Tucker 3 etc... ------------------------------------------------------------ This is the exact xml that is causing me great troubles: Complete Rough Draft of Functional Specs 5 Give Eck the rough draft so that we can rewrite it The rough Draft 20020208 2 3 1 ------------------------------------------------------------ So, when I call get_child_messages(), an exact copy of the above XML is returned in the message contained by the tm_list object. What _should_ come back is: Complete Rough Draft of Functional Specs 5 Give Eck the rough draft so that we can rewrite it The rough Draft 20020208 2 3 1 Can you help? Thanks for reading this far... :-)