pw.println("\t<category>" + current.getCategory() + "</category>");
pw.println("\t</internet>"); }  if (current.getCategory().length() > 0) { pw.println("\t<categories>"); if (current.getCategory().length() > 0) pw.println("\t\t<category>" + current.getCategory() + "</category>"); pw.println("\t</categories>"); }
	public void saveToXMLFile(String filename) {		Debug.msg("Saving to file " + filename);		FileOutputStream fos;		try {			fos = new FileOutputStream(filename);			PrintWriter pw = new PrintWriter(fos);			pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");			pw.println("<!DOCTYPE phonebook SYSTEM \"" + PHONEBOOK_DTD_URI					+ "\">");			pw.println("<phonebook>");			pw.println("<comment>Phonebook for " + JFritz.PROGRAM_NAME + " v"					+ JFritz.PROGRAM_VERSION + "</comment>");			Enumeration en = persons.elements();			while (en.hasMoreElements()) {				Person current = (Person) en.nextElement();				pw.println("<entry>");				pw.println("\t<firstname>" + current.getFirstName()						+ "</firstname>");				pw.println("\t<middlename>" + current.getMiddleName()						+ "</middlename>");				pw.println("\t<lastname>" + current.getLastName()						+ "</lastname>");				pw.println("\t<street>" + current.getStreet() + "</street>");				pw.println("\t<postcode>" + current.getPostalCode()						+ "</postcode>");				pw.println("\t<city>" + current.getCity() + "</city>");				pw.println("\t<homenumber>" + current.getHomeTelNumber()						+ "</homenumber>");				pw.println("\t<mobilenumber>" + current.getMobileTelNumber()						+ "</mobilenumber>");				pw.println("\t<businessnumber>"						+ current.getBusinessTelNumber() + "</businessnumber>");				pw.println("\t<othernumber>" + current.getOtherTelNumber()						+ "</othernumber>");				pw.println("\t<standardnumber>"						+ current.getStandardTelephoneNumber()						+ "</standardnumber>");				pw						.println("\t<email>" + current.getEmailAddress()								+ "</email>");				pw.println("\t<category>" + current.getCategory()						+ "</category>");				pw.println("</entry>");			}			pw.println("</phonebook>");			pw.close();		} catch (FileNotFoundException e) {			Debug.err("Could not write " + filename + "!");		}	}