Reflection only works on existing objects (and hence, classes). But you can construct classes from source code at runtime using a library like Javassist. This article I wrote for the JavaRanch Journal explains how it's done.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com