public static void printDocument(Document doc) {
		OutputFormat format = OutputFormat.createPrettyPrint();
		try {
			XMLWriter writer = new XMLWriter(System.out, format);
			writer.write(doc);
		} catch (Exception e) {
			System.err.println("Error while trying to print: " + e.getMessage());
			e.printStackTrace();
		}
	}