Venkat Divvela wrote:XML parser can't parse special characters like &,< and < etc. "&" has to be represented as & amp; (no space between & and amp;)in order to be processed by DOM parser.
That's very true. But if the ampersand hadn't been properly escaped in the document, then the parser would have thrown an exception. It wouldn't have just ignored it. So I suspect it was, and the escaping has been lost somewhere in the process of copying it and posting it here and displaying it in our browsers.
And that doesn't explain why only the part of the node before the ampersand was returned, either. My theory is that the element actually has more than one text child, and Bharat has just assumed that the text is all in a single child. Note that the Node interface has a "normalize" method, and if you read its documentation you'll see a mention of "adjacent Text nodes".