<html>
<head>
<script language ="JAVASCRIPT">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load("note.xml");
function readxml(node, level)
{
document.writeln('<table border="1" cellspacing="0" cellpadding="0">');
document.writeln('<tr>');
document.writeln('<td>');
if (node.nodeName == "#text")
{
document.writeln(node.text);
}
else
{
document.writeln(node.nodeName);
}
if (node.firstChild)
{
var checkparent = node.firstChild.parentNode.tagName
readxml(node.firstChild, level + 1);
}
if (node.nextSibling)
{
readxml(node.nextSibling, level);
}
document.writeln('</td>');
document.writeln('</tr>');
document.writeln('</TABLE>');
}
function callReadXml()
{
root = xmlDoc.documentElement;
readxml(root, 0);
}
</script>
</head>
<body onLoad=callReadXml()>
</body>
</html>

I was able to read all the xml file text and nodeName but i dunno how to write it in a table, the child of a node should be a table in it parent table, but all i seen to do is randomly create table can someone help?