title: Get line number from xml node - java
body: <p>I have parsed an XML file and have gotten a Node that I am interested in. How can I now find the line number in the source XML file where this node occurs?</p>
  
  <p>EDIT:
  Currently I am using the SAXParser to parse my XML. However I will be happy with a solution using any parser.</p>
  
  <p>Along with the Node, I also have the XPath expression for the node.</p>
  
  <p>I need to get the line number because I am displaying the XML file in a textbox, and need to  highlight the line where the node occured. Assume that the XML file is nicely formatted with sufficient line breaks.</p>