data manipulate on tree structure by jQuery
<p>Below is tree structure and i want to have second tree structure by jquery.</p>

<pre><code>&lt;ul&gt;
    &lt;li data-id="1"&gt;
        &lt;ul&gt;
            &lt;li data-id="2"&gt;
                &lt;ul&gt;
                    &lt;li data-id="6"&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li data-id="3"&gt;&lt;/li&gt;
    &lt;li data-id="4"&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>this is destination structure that i want to have so how can i do that ?</p>

<pre><code>&lt;ul&gt;
    &lt;li data-id="1" data-path="1"&gt;
        &lt;ul&gt;
            &lt;li data-id="2" data-path="1,2"&gt;
                &lt;ul&gt;
                    &lt;li data-id="6" data-path="1,2,6"&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li data-id="3" data-path="3"&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
