## 29.3 Creating XML Documents (cont.)

>     DOMElement* create_text_element(DOMDocument* doc,
>        string name, string text)
>     {
>        XMLCh* xtext = new XMLCh[text.length() + 1];
>        XMLString::transcode(text.c_str(), xtext, text.length());
>        DOMText* textNode = doc->createTextNode(xtext);
>        delete xtext;
>        DOMElement* r = create_element(doc, name);
>        r->appendChild(textNode);
>        return r;
>     }

prev |top |next