Get path to all XML's nodes
<p>I have an example XML as follows:</p>

<pre><code>&lt;message&gt;
  &lt;metadata&gt; 
    &lt;msg_id&gt;1&lt;/msg_id&gt;
    &lt;client_type&gt;type1&lt;/client_type&gt;
  &lt;/metadata&gt;
  &lt;individual&gt;
    &lt;name&gt;John&lt;/name&gt;
    &lt;surname&gt;Smith&lt;/surname&gt;
      &lt;additional_information&gt;
        &lt;e_mail&gt;aaa@gmail.com&lt;/e_mail&gt;
        &lt;phone_number&gt;11110000&lt;/phone_number&gt;
      &lt;/additional_information&gt;
  &lt;/individual&gt;
&lt;/message&gt;
</code></pre>

<p>my goal is to get output which will show me the path to every element XML like here:</p>

<pre><code>/message/metadata/msg_id
/message/metadata/client_type
/message/individual/name
</code></pre>

<p>and so one. How can I handle this in Java? </p>

<p>Thanks a lot in advance for any hints!</p>