private void validateMemberTargetingList(MemberShape member, ListShape targetList, List<ValidationEvent> events) {
        if (targetList.getMember().hasTrait(XmlNameTrait.ID)) {
            XmlNameTrait xmlName = targetList.getMember().expectTrait(XmlNameTrait.class);
            if (!member.getMemberName().equals(xmlName.getValue())) {
                events.add(warning(member,
                        String.format(
                                "Member is `@xmlFlattened`, so `@xmlName` of target's member (`%s`) has no effect."
                                        + " The flattened list elements will have the name of this member - `%s`. If this"
                                        + " is unintended, you can add `@xmlName(\"%s\")` to this member.",
                                targetList.getMember().getId(),
                                member.getMemberName(),
                                xmlName.getValue())));
            }
        }
    }
Validates that xmlFlattened members aren't unintentionally ignoring the
xmlName of their targets.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/XmlFlattenedTraitValidator.java