Parsing XML with multiple, identical tags
<p>Before adding anything else, I would like to mention that I have looked at other answers here. Unfortunately the answers didn't apply to my situation, and the best one just provided a smattering of code without actually answering anything.</p>

<p>I have XML files with contents such as this:</p>

<pre><code>&lt;TransactionLine status="normal"&gt;
 &lt;ItemLine&gt;
  &lt;ItemCode&gt;
   &lt;POSCodeFormat format="upcA"&gt;&lt;/POSCodeFormat&gt;
   &lt;POSCode&gt;074804007527&lt;/POSCode&gt;
   &lt;POSCodeModifier name="pc"&gt;1&lt;/POSCodeModifier&gt;
  &lt;/ItemCode&gt;
  &lt;Description&gt;EP  PK WINS EACH&lt;/Description&gt;
  &lt;EntryMethod method="scan"&gt;&lt;/EntryMethod&gt;
  &lt;ActualSalesPrice&gt;2.99&lt;/ActualSalesPrice&gt;
  &lt;MerchandiseCode&gt;1&lt;/MerchandiseCode&gt;
  &lt;SellingUnits&gt;1&lt;/SellingUnits&gt;
  &lt;RegularSellPrice&gt;2.99&lt;/RegularSellPrice&gt;
  &lt;SalesQuantity&gt;1&lt;/SalesQuantity&gt;
  &lt;SalesAmount&gt;2.99&lt;/SalesAmount&gt;
  &lt;ItemTax&gt;
   &lt;TaxLevelID&gt;101&lt;/TaxLevelID&gt;
  &lt;/ItemTax&gt;
  &lt;SalesRestriction&gt;
   &lt;SalesRestrictFlag value="no"  type="other"&gt;&lt;/SalesRestrictFlag&gt;
  &lt;/SalesRestriction&gt;
 &lt;/ItemLine&gt;
&lt;/TransactionLine&gt;
&lt;TransactionLine status="normal"&gt;
&lt;ItemLine&gt;
&lt;ItemCode&gt;
 &lt;POSCodeFormat format="upcA"&gt;&lt;/POSCodeFormat&gt;
 &lt;POSCode&gt;030004344770&lt;/POSCode&gt;
 &lt;POSCodeModifier name="pc"&gt;1&lt;/POSCodeModifier&gt;
&lt;/ItemCode&gt;
&lt;Description&gt;MCRFBER TOW EACH&lt;/Description&gt;
&lt;EntryMethod method="scan"&gt;&lt;/EntryMethod&gt;
&lt;ActualSalesPrice&gt;1&lt;/ActualSalesPrice&gt;
&lt;MerchandiseCode&gt;1&lt;/MerchandiseCode&gt;
&lt;SellingUnits&gt;1&lt;/SellingUnits&gt;
&lt;RegularSellPrice&gt;1&lt;/RegularSellPrice&gt;
&lt;SalesQuantity&gt;1&lt;/SalesQuantity&gt;
&lt;SalesAmount&gt;1&lt;/SalesAmount&gt;
&lt;ItemTax&gt;
 &lt;TaxLevelID&gt;101&lt;/TaxLevelID&gt;
&lt;/ItemTax&gt;
&lt;SalesRestriction&gt;
 &lt;SalesRestrictFlag value="no"  type="other"&gt;&lt;/SalesRestrictFlag&gt;
&lt;/SalesRestriction&gt;
&lt;/ItemLine&gt;
&lt;/TransactionLine&gt;
</code></pre>

<p>A given file will have multiple "Transaction Lines". The differentiating factor between them would be the POS Code. My main problem is, how do I drill down to the point where I can actually use that differentiating value to start tossing information into the necessary objects? Simply removing them as I go isn't an option. I can't control the XML output, so I can't make it more usable. I'm using XStrem as the XML parser. Solutions that are in Java are preferable, but Scala is also okay.</p>