private void parseReference(Element parentNode, String sectionName, int level) throws TemplateException {
        try {
            // look for section
            XPath xPath = XPathFactory.newInstance().newXPath();
            NodeList nodeList = (NodeList) xPath.evaluate("/grammar/define[@name='" + sectionName + "']", xml, XPathConstants.NODESET);
            for (int i = 0, len = nodeList.getLength(); i < len; i++) {
                Node currentNode = nodeList.item(i);
                if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
                    parseReportSectionLevel(parentNode, currentNode, CHILD_NORMAL, level + 1);
                }
            }
        }
        catch (XPathExpressionException e) {
            throw new TemplateException("XPathExpressionException", e);
        }
    }