public String buildConfigStructureAux(NodeList nl, Element element, String path){
	    	
	    String path_aux = path;
		String nodeName;
		Node node;
		NodeList cn;
		int cnSize;
		List<Node> lst;
	    int i = 0;	
	    while(nl.getLength() > i){
	    		
	        path=path_aux;
	    	node = nl.item(i);
	    	cn = node.getChildNodes();
	    	cnSize = cn.getLength();
	    	
	    	if(node.getNodeType() == Node.ELEMENT_NODE){
	    			
	    		nodeName = node.getNodeName();
	    		
	    		if(cnSize == 0){
	    			
	    		    List<String> nodeNamePaths = _paths.get(nodeName);
	    		    
	    			//testar se a folha ja existe noutro caminho
	    			if(_paths.containsKey(nodeName) && nodeNamePaths.size() > 1){
	    			    nodeName = changeNodeName(nodeNamePaths, path, nodeName);
	    			}
	    			
                    if(!_leafs.containsKey(nodeName)){
                        i++;
                        continue;
                    }
                        
                    lst = _leafs.get(nodeName);
                    
                    //System.out.println("Depois: " + nodeName);
	    			
                    Node n;
	    			for(int k = 0; lst.size() > k ; k++){
	    				Element el = this._OutputXMLDoc.createElement(nodeName);
	    				n = lst.get(k);
	    				el.appendChild(this._OutputXMLDoc.createTextNode(/*_sm.preProcessString(*/n.getTextContent()/*)*/));
	    							
	    				NamedNodeMap attrs = n.getAttributes();
	    				Node attr;
	    				for (int j=0; j<attrs.getLength(); j++) {
	    				    attr = attrs.item(j);
	    					el.setAttribute(attr.getNodeName(),/* _sm.preProcessString(*/attr.getTextContent()/*)*/);
	    				}
	    				
	    				element.appendChild(el);
	    			}

	    		}
	    			
	    		if(cnSize > 0){		
	    			
		    			Element el = this._OutputXMLDoc.createElement(nodeName);
			    		
			    		/*NamedNodeMap attrs = getGroupNodeAttributes(nodeName, _XMLStructureDoc.getDocumentElement());
			    		Node attr;
		    			for (int k=0; k<attrs.getLength(); k++) {
		    			    attr = attrs.item(k);
		    				el.setAttribute(attr.getNodeName(), attr.getTextContent());
		    			}*/
		    			
		    			element.appendChild(el);
	
		    			path = buildConfigStructureAux(cn, el, path + nodeName + "\\");
	    		}
	    			
	    	}
	    			
	    	i++;
	    }

	    return path;
	}