title: set limit to number of children in an element in xml
body: <p>I have an XML file as follows</p>
  
  <pre><code>&lt;abc&gt;
    &lt;property&gt;
      &lt;Recentlyopenedfiles&gt;
      &lt;File Path="c:\hai.txt" /&gt;
      &lt;File Path="C:\old.java" /&gt;
      &lt;/Recentlyopenedfiles&gt;
     &lt;/property&gt;
  &lt;/abc&gt;
  </code></pre>
  
  <p>I am using jdom2 SAXBuilder to parse the xml in java.I need to save all recently opened files in <code>&lt;Recentlyopenedfiles&gt;</code>. At the maximum this has to hold only three paths(i.e) 3 recently opened files path.</p>
  
  <p>So,I need to know </p>
  
  <ol>
  <li>Are there any mechanism to set limit to child nodes? </li>
  <li>How to index child and perform stack operation so that last opened file
  saved in first file path.</li>
  </ol>
  
  <p>Thanks.</p>