I know both ANTLR and JavaCC have full Java parsers. It should be straightforward to build an AST if they don't already, walk the tree and generate XML from that.
The Java Front end for the DMS Software Reengineering Toolkit parses Java, builds ASTs for it, and has a switch option on the parser to export XML directly.
There's a question about how you might use this in practice. The AST for a programming language isn't really interesting; you can only ask context-free questions.
To form more interesting queries, you usually need a bunch of auxiliary facts, such as the meaning of each symbol use (e.g., a symbol table mapping identifiers to types, and an map from instances to symbol table entries), and possibly data flow (given an assignment, where are the consumers of its result) and call facts (who calls what? complicated by Java's OO properties). If you want to ask a serious question of a "java program" (e.g., a set of cooperating classes) you'll need to collect all this data for a set of files and the cross linkages between them.
Simple AST-exporting tools won't provide this kind of information. A tool like DMS's Java front end does, and can handles thousands of files at once.
With all this additional information, queries are harder to write, too. XSLT won't come even close.