add YAML and XML example for Required and Optional field constraints in ...

...a Collection constraint

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes (symfony/symfony#7930)
| Applies to    | all
| Fixed tickets |