code: private static void writeParagraphs(final String text, final XmlStringBuilder xml) {
  		if (!Util.empty(text)) {
  			int start = 0;
  			int end = text.length() - 1;
  
  			// Set the start index to the first non-linebreak, so we don't emit leading ui:nl tags
  			for (; start < end; start++) {
  				char c = text.charAt(start);
  
  				if (c != '\n' && c != '\r') {
  					break;
  				}
  			}
  
  			// Set the end index to the last non-linebreak, so we don't emit trailing ui:nl tags
  			for (; start < end; end--) {
  				char c = text.charAt(end);
  
  				if (c != '\n' && c != '\r') {
  					break;
  				}
  			}
  
  			char lastChar = 0;
  
  			for (int i = start; i <= end; i++) {
  				char c = text.charAt(i);
  
  				if (c == '\n' || c == '\r') {
  					if (lastChar != 0) {
  						xml.write("<ui:nl/>");
  					}
  
  					lastChar = 0;
  				} else {
  					xml.write(c);
  					lastChar = c;
  				}
  			}
  		}
  	}
docs: Writes out paragraph delimited content.
  
  @param text the String content to output.
  @param xml the XmlStringBuilder to paint to.