I'm sorry but I can't share my code.
The DLQ is stored using an hsql local database. If you can connect to this local database, you should be able to browse the DLQ with a simple query :
SELECT messageid FROM jms_messages WHERE destination = 'QUEUE.DLQ'
The configuration file is hsqldb-ds.xml in jbossdir/server/xxxx/deploy/
The default datasource name is <jndi-name>DefaultDS</jndi-name>
So you should be able to connected using something like
dataSource = (DataSource) context.lookup("java:/DefaultDS");
dataSource.createConnection().createStatement(...