1<html>
2<body>
3
4<p id="demo"></p>
5
6<script>
7var text, parser, xmlDoc;
8
9text = "<bookstore><book>" +
10"<title>Everyday Italian</title>" +
11"<author>Giada De Laurentiis</author>" +
12"<year>2005</year>" +
13"</book></bookstore>";
14
15parser = new DOMParser();
16xmlDoc = parser.parseFromString(text,"text/xml");
17
18document.getElementById("demo").innerHTML =
19xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
20</script>
21
22</body>
23</html>