public static Document getDocument(String URL, Properties properties)
			throws SAXException, IOException, ParserConfigurationException {
		URL url = new URL(URL);
		HttpURLConnection connection = (HttpURLConnection) url.openConnection();
		connection.setDoOutput(true);
		connection.setDoInput(true);
		connection.setRequestMethod("POST");

		StringBuilder sb = new StringBuilder();
		for (String key : properties.stringPropertyNames()) {
			sb.append((key + '=' + properties.getProperty(key) + '&'));
		}
		if (sb.length() > 0) {
			sb.deleteCharAt(sb.length() - 1);
		}
		OutputStreamWriter out = new OutputStreamWriter(
				connection.getOutputStream());
		out.write(sb.toString());
		out.close();

		InputStream stream = connection.getInputStream();
		return DocumentBuilderFactory.newInstance().newDocumentBuilder()
				.parse(stream);

	}