code: public static String getTokenText(INode node) {
  		if (node instanceof ILeafNode)
  			return ((ILeafNode) node).getText();
  		else {
  			StringBuilder builder = new StringBuilder(Math.max(node.getTotalLength(), 1));
  			boolean hiddenSeen = false;
  			for (ILeafNode leaf : node.getLeafNodes()) {
  				if (!leaf.isHidden()) {
  					if (hiddenSeen && builder.length() > 0)
  						builder.append(' ');
  					builder.append(leaf.getText());
  					hiddenSeen = false;
  				} else {
  					hiddenSeen = true;
  				}
  			}
  			return builder.toString();
  		}
  	}
docs: This method converts a node to text.
  
  Leading and trailing text from hidden tokens (whitespace/comments) is removed. Text from hidden tokens that is
  surrounded by text from non-hidden tokens is summarized to a single whitespace.
  
  The preferred use case of this method is to convert the {@link ICompositeNode} that has been created for a data
  type rule to text.
  
  This is also the recommended way to convert a node to text if you want to invoke
  {@link org.eclipse.xtext.conversion.IValueConverterService#toValue(String, String, INode)}