1Create a DocumentBuilder instance.
2Create a Document from the above DocumentBuilder .
3Create the elements you want using the Element class and its appendChild method.
4Create a new Transformer instance and a new DOMSource instance.
5Create a new StreamResult to the output stream you want to use