var tagRoot = new XML("<book>"); tagRoot.p = "hello now"; tagRoot.p.bold = "brown"; tagRoot.p.appendChild (" cow"); alert(tagRoot.toXMLString())
tagRoot.p += " cow" will first convert the contents of the <p> tag to string, then append to it the word "cow" then assign the new string content to the <p> tag.
Hi Vamitul, This is close! (Sorry for the delay in reply out of country.) The only issue is with line breaks and spaces being inserted. Thanks for taking a look, very much appreciated.
By default .toXMLString pretty-prints the xml. It only affects the string conversion.
To disable that use
Thank-you, thank-you, thank-you.