@Test
public void readElements() {

	ResourceLoader resourceLoader = new ResourceLoader("collection/test-collections.xml");
	Document document = resourceLoader.getDocument();
	
	//get collection list
	@SuppressWarnings("unchecked")
	List<Element> collectionList = document.selectNodes("//collection");
	
	System.out.println(collectionList);
	
	for(Element node : collectionList) {
		System.out.println(node.elementText("analyzer"));
		System.out.println(node.elementText("indexingDirectory"));
		
		@SuppressWarnings("unchecked")
		List<Element> fieldsList = document.selectNodes("//field");
		for(Element e : fieldsList) {
			System.out.println(e.attributeValue("name"));
			System.out.println(e.attributeValue("store"));
			System.out.println(e.attributeValue("index"));
			System.out.println(e.attributeValue("type"));
			System.out.println(e.attributeValue("analyze"));
			System.out.println(e.attributeValue("must"));
			System.out.println(e.attributeValue("boost"));
		}
		
		@SuppressWarnings("unchecked")
		List<Element> defaultSearchFields = document.selectNodes("//defaultSearchField");
		for(Element e : defaultSearchFields) {
			System.out.println(e.attributeValue("name"));
		}
		
		@SuppressWarnings("unchecked")
		List<Element> sortFields = document.selectNodes("//sortField");
		for(Element e : sortFields) {
			System.out.println(e.attributeValue("source"));
			System.out.println(e.attributeValue("dest"));
		}
	}
}