Better xml-based class creation