Java tutorial
//package com.java2s; import java.io.IOException; import java.io.OutputStream; public class Main { public static void startXmlNode(OutputStream out, String indent, String name) throws IOException { print(out, indent); out.write('<'); print(out, name); out.write('>'); out.write('\n'); } public static void print(OutputStream out, String str) throws IOException { out.write(str.getBytes("UTF-8")); //$NON-NLS-1$ } }