I have found the problem.. I was building this program as part of a larger project, and there was an older versions of xerces in the classpath. Once I removed this it fixed my problem.
Cheers, Keith