i'm new to this dom im going to get the tha last child of this xml document but unable to get this can anybody explain why my code seems correct to me but but dont know why it is not getting the messages lastchild's, so what are the other possible ways to do this , i just want to get the talk 123
the xml file
<messages category="short">
<person1>
<time>
r
<message>Djssjs</message>
</time>
</person1>
<person2>
<time>
r
<message>1234fdg</message>
</time>
</person2>
<person1>
<time>
r
<message> talk 123</message>
</time>
</person1>
</messages>
javascript
msg = getElementsByTagName("messages").lastChild.childNodes[1].nodeValue ;
document.getElementById("demo").innerHTML = msg;