title: Iterating over different elements and changing a particular one in JSoup
body: <p>I need to change a few elements, which are nested deep within a musicxml file. I use jSoup to parse the document and perform my calculations. </p>
  
  <p>Now I want to expert the jsoup doc and make a few modifications first. The problem is, within the xml file, the elements don't have a unique identifier (e.g. there are many notes and measures, notes are not numbered). </p>
  
  <p>I loop through the document like this. And after certain criteria are met, I want to change the particular note. Using this iter in java uses a copy, so modifying the elements doesn't make a difference on the original doc. Could I use for i = 0; i &lt; ?? or something? Would this go over the elements in the same order (important for checking criteria). </p>
  
  <pre><code>for (Element thismeasure : thisPart.getElementsByTag("measure")) {
  
                  for (Element thisnote : thismeasure.children()) {
  </code></pre>