Validating XML against XSD

Hi Folks,      I got into a pitch hole when during the development stage of my project when I came across a scenario where in I had to validate an XML against and XSD.After a hell lot of googling, I couldnt really manage to find a solution for the same.At last I found a commad line utility called xmlstartlet whcih i integrated into my project and generated a helper out of it to use its functionality under the rails framework.The way wokred around it could be found right our here on my blog..

But i find find this as an ultimate solution when considering the time performance of the projetc as every request for the XSD based validation is routed to some external utility...!...Can anybody tell me if therez any better work around for this issue...and any other ruby based library or plugin which can help me out with this???

Thanks...! Raghu