docs: private static InterestRateSwapLegProductDescriptor getSwapLegProductDescriptor(Element leg, String forwardCurveName, String discountCurveName,
  			DayCountConvention daycountConvention) {
  
  		boolean isFixed = leg.getElementsByTagName("interestType").item(0).getTextContent().equalsIgnoreCase("FIX");
  
  		ArrayList<Period> periods 		= new ArrayList<>();
  		ArrayList<Double> notionalsList	= new ArrayList<>();
  		ArrayList<Double> rates			= new ArrayList<>();
  
  		//extracting data for each period
  		NodeList periodsXML = leg.getElementsByTagName("incomePayment");
  		for(int periodIndex = 0; periodIndex < periodsXML.getLength(); periodIndex++) {
  
  			Element periodXML = (Element) periodsXML.item(periodIndex);
  
  			LocalDate startDate	= LocalDate.parse(periodXML.getElementsByTagName("startDate").item(0).getTextContent());
  			LocalDate endDate	= LocalDate.parse(periodXML.getElementsByTagName("endDate").item(0).getTextContent());
  
  			LocalDate fixingDate	= startDate;
  			LocalDate paymentDate	= LocalDate.parse(periodXML.getElementsByTagName("payDate").item(0).getTextContent());
  
  			if(! isFixed) {
  				fixingDate = LocalDate.parse(periodXML.getElementsByTagName("fixingDate").item(0).getTextContent());
  			}
  
  			periods.add(new Period(fixingDate, paymentDate, startDate, endDate));
  
  			double notional		= Double.parseDouble(periodXML.getElementsByTagName("nominal").item(0).getTextContent());
  			notionalsList.add(new Double(notional));
  
  			if(isFixed) {
  				double fixedRate	= Double.parseDouble(periodXML.getElementsByTagName("fixedRate").item(0).getTextContent());
  				rates.add(new Double(fixedRate));
  			} else {
  				rates.add(new Double(0));
  			}
  
  		}
  
  		ScheduleDescriptor schedule = new ScheduleDescriptor(periods, daycountConvention);
  		double[] notionals	= notionalsList.stream().mapToDouble(Double::doubleValue).toArray();
  		double[] spreads	= rates.stream().mapToDouble(Double::doubleValue).toArray();
  
  		return new InterestRateSwapLegProductDescriptor(forwardCurveName, discountCurveName, schedule, notionals, spreads, false);
  	}