here it goes...
XYZDocument xyzDoc = XYZDocument .Factory.parse(xmlString); //xmlString is an xml in
String format.
boolean flag=xyzDoc.validate();
Since I'd used namespace while creating xsd and the xml which I am getting doesn't have any namespace
specified in it,I am getting the value of falg=false.
Compiler says
org.apache.xmlbeans.XmlException: error: The document is not a XYZ@http://www.abc.com/sud/xyz: document element namespace mismatch expected "http://www.abc.com/sud/xyz" got ""