I think you should take a look at this answer. What's not clear, for sure, is what kind of UI do you want generated and maintained; the post I refer to covers a wide range of scenarios, even though the question was specific to HTML.
The twist may be that these days, rules in XSD, particularly if you start thinking about XSD 1.1, have a whole new meaning. It that is what you had in mind, while co-constraints may still be easy to add, conditional type assignments are not. Regardless, XSD 1.1 is a long way from having any significant adoption, if only because of limited availability of fully compliant and free processors.