Java tutorial
//package com.java2s; public class Main { public static StringBuilder value(StringBuilder builder, String type, String name, String value) { builder.append("<dia:attribute name=\"").append(name); builder.append("\"><dia:").append(type).append(">"); builder.append(value); builder.append("</dia:").append(type).append("></dia:attribute>"); return builder; } }