public String toJSON ( boolean bPretty ) { int indent = bPretty ? 3 : 0 ; JSONEmitter json = new JSONEmitter ( indent ) ; json . startDocument ( ) ; toJSON ( json ) ; json . endDocument ( ) ; return json . toString ( ) ; }
Convert the DOM tree rooted at this UNode into a JSON document . Optionally format the text with indenting to make it look pretty .