handle Optional and Required constraints from XML or YAML sources correctly