Java tutorial
//package com.java2s; import java.io.BufferedWriter; import java.io.IOException; public class Main { public static void writeAttribute(String name, String value, BufferedWriter w) throws IOException { w.write(name + "=\"" + value + "\""); } public static void writeAttribute(String name, long value, BufferedWriter w) throws IOException { w.write(name + "=\"" + value + "\""); } public static void writeAttribute(String name, double value, BufferedWriter w) throws IOException { w.write(name + "=\"" + value + "\""); } public static void writeAttribute(String name, boolean value, BufferedWriter w) throws IOException { w.write(name + "=\"" + value + "\""); } }