code: function(node, before)
  	{
  		var tmp = (before) ? node.previousSibling : node.nextSibling;
  		
  		while (tmp != null && tmp.nodeType == mxConstants.NODETYPE_TEXT)
  		{
  			var next = (before) ? tmp.previousSibling : tmp.nextSibling;
  			var text = mxUtils.getTextContent(tmp);
  			
  			if (mxUtils.trim(text).length == 0)
  			{
  				tmp.parentNode.removeChild(tmp);
  			}
  			
  			tmp = next;
  		}
  	}
docs: Function: removeWhitespace
  
  Removes the sibling text nodes for the given node that only consists
  of tabs, newlines and spaces.
  
  Parameters:
  
  node - DOM node whose siblings should be removed.
  before - Optional boolean that specifies the direction of the traversal.