title: Converting HTML file into XML document using php, how to do it?
body: <p>I want to convert an HTML file into an XML document using php. I've googled and been through some of stackoverflow's questions, but couldn't find any solution.</p>
  
  <p>This is my html code and i want to convert it into XML doc.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;ul&gt;
      &lt;li&gt;Section 1&lt;/li&gt;
      &lt;li&gt;Section 2
          &lt;ul&gt;
              &lt;li&gt;Section 2.1&lt;/li&gt;
              &lt;li&gt;Section 2.2&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Section 3&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and i want it into </p>
  
  <pre><code>&lt;root&gt;
      &lt;part&gt;
          &lt;number&gt;Section 1&lt;/number&gt;
          &lt;number&gt;Section 2&lt;/number&gt;
              &lt;child_number&gt;Section 2.1&lt;/child_number&gt;
              &lt;child_number&gt;Section 2.2&lt;/child_number&gt;
          &lt;number&gt;Section 3&lt;/number&gt;
      &lt;/part&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>if there is any technique for converting this html file into XML using php, then please help me.
  Any help would be thankful. </p>