What is Shankh???


Shankh is a synonym for Conch Shell.So why that name for this blog?? My grandma used to say "When you put the conch shell to your ear, you hear the sound of ocean". Ignoring all scientific explanations to it, i would like this blog to bring you the sound of vast ocean of technology. Take a look

Some Random quotes


Innovation distinguishes between a leader and a follower. -Steve Jobs

It is not that i am smarter than others, i just persist with problems longer

Jaxb: Printing Xml with proper formatting

Ever wondered when we print xml, instead of printing it in single line can’t we print with proper formatting and indentation.  If you are using Jaxb then there is a  nice little trick in  to achieve that.


JAXBContext jc = JAXBContext.newInstance( "MyClass.class" );

Marshaller marshaller = jc.createMarshaller();

marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );

marshaller.marshal( <object_to_marshal>, System.out );

  • Share/Bookmark

One Response to “Jaxb: Printing Xml with proper formatting”

  1. Don Says:

    works like a treat

Leave a Reply

Subscribe to Comments?