But you already process these duplicates. I modified your code a little like
switch (event) {
case XMLStreamConstants.START_ELEMENT:
System.out.println(xmlStreamReader.getLocalName());
switch (xmlStreamReader.getLocalName()) {
and the System.out
delivers:
XLIFF
xliff
file
body
group
context-group
context
context
context
target-unit
source
target
You see the multiple context
outputs. Now you have to adapt your data structure to hold lists of context elements and not only one.