title: Create nested elements dynamically using XQuery and xpath
body: <p>How can we use path seperated by /(slash) for creating nested elements dynamically using xquery.</p>
  
  <p>For example, </p>
  
  <p>If  XML is like below structure</p>
  
  <pre><code>&lt;Document&gt; &lt;Header&gt; &lt;Body&gt; &lt;/Body&gt; &lt;/Header&gt; &lt;/Document&gt;
  </code></pre>
  
  <p>and if the parameter is Document/Header/Footer then nodes should be created like below.</p>
  
  <pre><code>&lt;Document&gt; &lt;Header&gt; &lt;Body&gt; &lt;/Body&gt; &lt;/Header&gt; **&lt;Footer&gt; &lt;/Footer&gt;** &lt;/Document&gt;
  </code></pre>
  
  <p>Above is only example.Can any one help me in providing generic node creation based on input path</p>