public static String xmlNode(String name,String attributes,String content,boolean indent){
  String start=attributes == null ? name : name + attributes;
  if (content == null) {
    return "<" + start + "/>\n";
  }
  if (indent && content.indexOf('\n') >= 0) {
    content="\n" + indent(content);
  }
  return "<" + start + ">"+ content+ "</"+ name+ ">\n";
}

public static String xmlNode ( String name , String attributes , String content , boolean indent ) { String start = attributes == null ? name : name + attributes ; if ( content == null ) { return "<" + start + "/>\n" ; } if ( indent && content . indexOf ( '\n' ) >= 0 ) { content = "\n" + indent ( content ) ; } return "<" + start + ">" + content + "</" + name + ">\n" ; }
create an xml node with optional attributes and content . the data is indented with 4 spaces if it contains a newline character and the indent parameter is set to true .
