@Test
public void writeGISElementAttributesElementGISElementXMLBuilderXMLResources() throws Exception {

	PathBuilder pathBuilder = new SimplePathBuilder();
	XMLResources res = new XMLResources(pathBuilder);
	MapPoint point = new MapPoint(3, 4);
	point.setName("name1"); //$NON-NLS-1$
	point.setAttribute("attr1", "Text"); //$NON-NLS-1$ //$NON-NLS-2$
	final String source = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?><root><a><b id=\"v\"/></a></root>"; //$NON-NLS-1$
	final Document doc;
	try (ByteArrayInputStream reader = new ByteArrayInputStream(source.getBytes())) {
		doc = XMLUtil.readXML(reader);
	}
	XMLBuilder xmlBuilder = new XMLBuilder() {
		@Override
		public Document getDocument() throws DOMException {
			return doc;
		}
	};
	XMLGISElementUtil.writeGISElementAttributes(doc.getDocumentElement(), point, xmlBuilder, res);
	
	String actual;
	try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
		XMLUtil.writeXML(doc, baos);
		baos.flush();
		actual = new String(baos.toByteArray());
	}
	final String id = point.getUUID().toString();
	final String expected = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" //$NON-NLS-1$
			+ "<root geoId=\"39e072ec9ca6460ee679103fd10d53dc#3;4;3;4\" " //$NON-NLS-1$
			+ "id=\"" + id + "\" name=\"name1\">" //$NON-NLS-1$ //$NON-NLS-2$
			+ "<a><b id=\"v\"/></a>" //$NON-NLS-1$
			+ "<attributes><attribute name=\"attr1\" type=\"STRING\" value=\"Text\"/></attributes>" //$NON-NLS-1$
			+ "</root>"; //$NON-NLS-1$
	assertEquals(expected, actual);
}