var result = document.getElementById("result"); result.firstChild.nodeValue = result.attributes.getNamedItem("text").value;