public static void startTag(StringWriter xml, String tag,
			Hashtable attributes)
	{
		xml.write("<" + tag);

		if (attributes != null)
		{
			Enumeration keys = attributes.keys();

			while (keys.hasMoreElements())
			{
				String key = keys.nextElement().toString();
				String value = (String) attributes.get(key);

				xml.write(" " + key + "='" + removeInvalidChars(value) + "'");
			}
		}
		xml.write(">\n");
	}