@Test
public void readRoadNetworkElementPathBuilderXMLResources() throws Exception {

	URL xmlFile = Resources.getResource(XMLRoadUtilTest.class, "network.xml"); //$NON-NLS-1$
	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	DocumentBuilder builder = factory.newDocumentBuilder();
	Document doc;
	try (InputStream is = xmlFile.openStream()) {
		doc = builder.parse(is);
	}
	PathBuilder pathBuilder = new SimplePathBuilder();
	XMLResources res = new XMLResources(pathBuilder);
	Point2d p;
	RoadSegment polyline;
	StandardRoadNetwork network = XMLRoadUtil.readRoadNetwork(doc.getDocumentElement(), pathBuilder, res);
	Collection<? extends RoadSegment> list = network.getRoadSegments();
	assertEquals(2, list.size());
	Iterator<? extends RoadSegment> segmentIterator = list.iterator();
	polyline = segmentIterator.next();
	Iterator<Point2d> pts = polyline.pointIterator();
	p = pts.next();
	assertEpsilonEquals(1., p.getX());
	assertEpsilonEquals(2., p.getY());
	p = pts.next();
	assertEpsilonEquals(-3., p.getX());
	assertEpsilonEquals(4., p.getY());
	p = pts.next();
	assertEpsilonEquals(5., p.getX());
	assertEpsilonEquals(-6., p.getY());
	assertFalse(pts.hasNext());
	assertEquals("name1", polyline.getName()); //$NON-NLS-1$
	assertEquals(ColorNames.getColorFromName("orange").intValue(), polyline.getAttribute("color", 0xFFFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
	assertEquals("Text", polyline.getAttribute("attr1", (String) null)); //$NON-NLS-1$ //$NON-NLS-2$
	polyline = segmentIterator.next();
	pts = polyline.pointIterator();
	p = pts.next();
	assertEpsilonEquals(1., p.getX());
	assertEpsilonEquals(2., p.getY());
	p = pts.next();
	assertEpsilonEquals(-1., p.getX());
	assertEpsilonEquals(-2., p.getY());
	p = pts.next();
	assertEpsilonEquals(1., p.getX());
	assertEpsilonEquals(-2., p.getY());
	assertFalse(pts.hasNext());
	assertEquals("name2", polyline.getName()); //$NON-NLS-1$
	assertEquals(ColorNames.getColorFromName("red").intValue(), polyline.getAttribute("color", 0xFFFFFF)); //$NON-NLS-1$ //$NON-NLS-2$
	assertEquals("Text2", polyline.getAttribute("attr2", (String) null)); //$NON-NLS-1$ //$NON-NLS-2$
}