Generating Valid xml Values from XSD in Java
===

My objective is to generate some valid and some invalid values for different elements whose syntactic rules are defined in an XSD. Here is what I intend to do step by step :
1. Check the different rules of the particular element by using Xpath of that element.
2. Generate a Value which conforms to the rules i.e.  a  valid value
2. Generate a Value which does not conform to the rules i.e.  an valid value

Please llet me know how is this possible in Java and also if the approach I intend to take is correct or if anybody has a better solution.

Thanks

Akki