title: Reading an XSD file to get all the elements and corresponding attributes in Java
body: <p>My requirement is to read an XSD file and to get all its elements with corresponding attributes in java. I've been trying to convert my XSD file to a sample XML file as parsing an XML file to get all it's elements and attributes is easy. But so far I've been unable to find a good enough tool in java to programmatically convert my XSD to sample XML. </p>
  
  <p>Is there any free and good java code available to convert an XSD to its sample XML?</p>
  
  <p>Or else what is the way I can read all the elements and attributes that a sample XML would contain directly from the XSD file? </p>
  
  <p>Thanks in advance!</p>