Martin Olsen wrote: On Wednesday 07 October 2009 13:07:41 you wrote:Use xmlTextWriterStartElement or xmlTextWriterStartElementNS with xmlTextWriterFullEndElementThanks! Unfortunately, I still get the same result. Here's the smallest code to reproduce: writer = xmlNewTextWriterDoc( &doc, 0 ); xmlTextWriterStartDocument( writer, NULL, "UTF-8", NULL ); xmlTextWriterStartElement( writer, BAD_CAST "element" ); xmlTextWriterFullEndElement( writer ); xmlTextWriterEndDocument( writer ); xmlSaveFile( "-", doc ); Any other suggestions? Just add empty space in the tag. That will force the <tag></tag> |