Jackson XML deserialization skips field when using multiple useWrapping = false

For any property, you can specify a method to use as the setter or getter using Jackson annotations (JsonSetter and JsonGetter). When you just a need a little modification to what Jackson is doing, then this seems easier that writing a custom deserializer / serializer for the whole class. Jackson also has a JsonAnySetter annotation that is a fallback to use for something not specified in your class (I've found that to be handy sometimes; I've used that to put all XML attributes of a type of element into a single Map rather than having to have properties for every possible attribute).

You could add custom XML deserialization methods to your Root class. Something like this:

@JsonSetter(value =  "foo")
public void setFooFromXml(Foo foo) {
    if (this.foos == null) {
        this.foos = new ArrayList<Foo>();
    } 
    this.foos.add(foo);
}

@JsonSetter(value =  "bar")
public void setBarFromXml(Bar bar) {
    if (this.bars == null) {
        this.bars = new ArrayList<Bar>();
    } 
    this.bars.add(bar);
}

Using Jackson to deserialize the XML like this:

try {
    String input = "<root><foo name=\"AAA\" /><bar name=\"BBB\" /><foo name=\"CCC\" /></root>";
    XmlMapper mapper = new XmlMapper();
    Root root = mapper.readValue(input, Root.class);
    System.out.println(root.getBars());
    System.out.println(root.getFoos());
    
} catch (Exception e) {
    e.printStackTrace();
}

Gives an output of this (after adding some simple toString() and getter methods):

[Bar [name=BBB]]
[Foo [name=AAA], Foo [name=CCC]]

I must recognize that I usually only use Jackson for JSON handling, but it seems that it is a known limitation of the jackson-dataformat-xml library:

Prior to 2.12 (not yet released as of May 2020), handling of repeated XML elements was problematic (it could only retain the last element read), but #403 improves handling

Maybe this issue could be related with your problem.

As a workaround, if possible, you can apply some kind of XSLT transformation to the XML documents before processing them, so that all nodes with the same name are grouped together, and see if the result is as expected.

You can also try another deserialization alternatives, mainly, JAXB, or direct XML processing.