This has been fixed, the sChar* was not able to handle the Chinese characters. I have converted the string into DOMString. now everything works fine.
DOMString val = DOMString( value.c_str() );
DOM_Text newNode = document.createTextNode("");
newNode.setNodeValue( val );
element.appendChild( newNode );
Now i am seeing proper end of tag .