title: What is the unique identifier for a DOM element/node
body: <p>I am traversing a HTML document using javascript DOM. I want make  a list (an array actually) of all nodes/elements and their values. I found a script for traversing DOM, but how do I store each node value in an array. I can't seem to find the unique identifier for a node. Anyone has any pointers? I was thinking of <code>xpath</code> or something.</p>
  
  <p>Is it a good idea to consider <code>xpath</code> for node as the unique identifier. If so how do I get <code>xpath</code> of a element while traversing the DOM?</p>