<script type="text/javascript" src="/example/xdom/loadxmldoc.js">
<script type="text/javascript">
function get_previoussibling(n)
xmlDoc=loadXMLDoc("/example/xdom/books.xml");
var x=xmlDoc.getElementsByTagName("author")[0];
document.write(x.nodeName);
document.write(x.childNodes[0].nodeValue);
var y=get_previoussibling(x);
document.write("<br />Previous sibling: ");
document.write(y.nodeName);
document.write(y.childNodes[0].nodeValue);