Compressing select XML elements in Java
===

I have a DOM representation of an XML (org.w3c.dom.Document).

I want to be able to compress certain elements of the XML and add them under a new compressedElem tag or so.

I would like to know what is the commonly used compression algorithm?
Wouldn't it be easier to search the element nodes and compress them with the DOM representation or should I go for any other representation?

I am just reading up on XML, storing XMLs in the form of DOM etc and started working with them using Java. Hence sorry for the noob question.

