I don't understand the question. Is it a class or an object which you want to convert? And why Xerces? Xerces is a parser, and the job of a parser is to convert an XML document into some internal format. Converting a Java object to XML is exactly the opposite. That's called serialization.