public void write(Kml kml) throws KmlException {
		kml.println("<ExtendedData" + getIdAndTargetIdFormatted(kml) + (nameSpace != null ? " mlns:prefix=\"" + nameSpace + "\"" : "") + ">", 1);
		if (dataElements != null) {
			for (Data data : dataElements) {
				data.write(kml);
			}
		}
		if (schemaUrl != null || simpleDataElements != null) {
			kml.println("<SchemaData" + (schemaUrl != null ? " schemaUrl=\"" + schemaUrl + "\"" : "") + ">", 1);
			if (simpleDataElements != null) {
				for (SimpleData simpleData : simpleDataElements) {
					simpleData.write(kml);
				}
			}
			kml.println("</SchemaData>");
		}
		if (customContent != null) {
			kml.println(customContent);
		}
		kml.println(-1, "</ExtendedData>");
	}