private void printDatabase(String dbName, List<ORASSNode> roots) throws MainException {
		
		writer.println("<?xml version=\"1.0\"?>");
		writer.println("<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"");
		writer.println("targetNamespace=\"http://www.w3schools.com\"");
		writer.println("xmlns=\"http://www.w3schools.com\"");
		writer.println("elementFormDefault=\"qualified\">");
		writer.println();
		
		// root element of XML document is the database name
		writer.println("\t<xs:element name=\""+dbName+"\" type=\""+dbName+"_Type\"/>");
		writer.println("\t<xs:complexType name=\""+dbName+"_Type\">");
		writer.println("\t\t<xs:all>");
		
		printElementDeclarations(roots);
		
		writer.println("\t\t</xs:all>");
		writer.println("\t</xs:complexType>");
		writer.println();
		
		printTables(roots);
		
		printKeys(roots);
		
		printKeyRefs(roots, dbName);
		
		printUniqueConstraints(roots);
		
		writer.println("</xs:schema>");
		
	}