QUERY DOCUMENT...

Hi all,
can someone tell me how can i get the whole document as a result of query written in java application…i mean…some java code in which when we write any query then it should show the whole document instead of showing only some parts of it…like given in the examples, where it takes the NODE NAME as an input parameter and then just shows that particular nodes only…how can i get the whole document???as in the case of normal query. when we write the doctype for example and it shows the whole document (e.g. /books and it shows the whole document)…can someone tell me PLEASEEEE…
Regards,
Shuch.