title: Parse xml file which has multiple child elements and sub root elements using java
body: <p>I am looking for a Java tool which can parse the XML file which has multiple child elements and sub root elements,
  Here, is the sample content from my xml file</p>
  <pre><code>   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;root_element&gt;
     &lt;MajorVersion&gt;10&lt;/MajorVersion&gt;
     &lt;MinorVersion&gt;0&lt;/MinorVersion&gt;
     &lt;sub_element1&gt;
        &lt;ActivateRule1&gt;0&lt;/ActivateRule1&gt;
        &lt;ActivateRule12&gt;false&lt;/ActivateRule12&gt;
        &lt;Classes&gt;
           &lt;Class&gt;
              &lt;Name&gt;Default&lt;/Name&gt;
              &lt;Type&gt;User&lt;/Type&gt;
              &lt;Data&gt;data content&lt;/Data&gt;
              &lt;Description&gt;User class&lt;/Description&gt;
           &lt;/Class&gt;
           &lt;Class&gt;
              &lt;Name&gt;class2&lt;/Name&gt;
              &lt;Type&gt;User&lt;/Type&gt;
              &lt;Data&gt;data conten2&lt;/Data&gt;
              &lt;Description /&gt;
           &lt;/Class&gt;
        &lt;/Classes&gt;
        &lt;Policies&gt;
           &lt;policyDefinition&gt;
              &lt;Name&gt;p1&lt;/Name&gt;
              &lt;Id&gt;121&lt;/Id&gt;
              &lt;Type&gt;Binary&lt;/Type&gt;
              &lt;Valued&gt;false&lt;/Valued&gt;
              &lt;Description&gt;Destination&lt;/Description&gt;
              &lt;AssociatedClass /&gt;
           &lt;/policyDefinition&gt;
           &lt;policyDefinition&gt;
              &lt;Name&gt;p1&lt;/Name&gt;
              &lt;Id&gt;121&lt;/Id&gt;
              &lt;Type&gt;BinaryData&lt;/Type&gt;
              &lt;Valued&gt;false&lt;/Valued&gt;
              &lt;Description&gt;Destination&lt;/Description&gt;
              &lt;AssociatedClass /&gt;
           &lt;/policyDefinition&gt;
        &lt;/Policies&gt;
        &lt;Filters&gt;
           &lt;f1&gt;false&lt;/f1&gt;
           &lt;f2&gt;true&lt;/f2&gt;
        &lt;/Filters&gt;
     &lt;/sub_element1&gt;
     &lt;sub_element2&gt;
        &lt;Policies&gt;
           &lt;policyDefinition&gt;
              &lt;Name&gt;p1&lt;/Name&gt;
              &lt;Id&gt;121&lt;/Id&gt;
              &lt;Type&gt;BinaryData&lt;/Type&gt;
              &lt;Valued&gt;false&lt;/Valued&gt;
              &lt;Description&gt;Destination&lt;/Description&gt;
              &lt;AssociatedClass /&gt;
           &lt;/policyDefinition&gt;
           &lt;policyDefinition&gt;
              &lt;Name&gt;p1&lt;/Name&gt;
              &lt;Id&gt;121&lt;/Id&gt;
              &lt;Type&gt;BinaryData&lt;/Type&gt;
              &lt;Valued&gt;false&lt;/Valued&gt;
              &lt;Description&gt;Destination&lt;/Description&gt;
              &lt;AssociatedClass /&gt;
           &lt;/policyDefinition&gt;
        &lt;/Policies&gt;
     &lt;/sub_element2&gt;
  &lt;/root_element&gt;
  </code></pre>
  <p>Can anyone please suggest which java tool can be used, and I also read that xml parsers are also suggested based on the file sizes, My typical file sizes will be of 2 to 3Mb
  Thanks in Advance</p>