I have a XML input
id string 42
Try xmlbeans it has some tools one of them is ins2xsd you can find specifics here: http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html Good luck