private void parseNodes(XNode node) {
StringBuilder sqlBuffer = new StringBuilder(sql);
NodeList children = node.getNode().getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
XNode child = node.newXNode(children.item(i));
String nodeName = child.getNode().getNodeName();
if (child.getNode().getNodeType() == Node.CDATA_SECTION_NODE
|| child.getNode().getNodeType() == Node.TEXT_NODE) {
String data = child.getStringBody();
InlineParameterMapParser inlineParameterMapParser = new InlineParameterMapParser(configuration);
SqlText sqlText = inlineParameterMapParser.parseInlineParameterMap(data);
sqlText.setPostParseRequired(false);
parameterMappings.addAll(sqlText.getParameterMappings());
sqlBuffer.append(sqlText.getText());
} else if ("include".equals(nodeName)) {
String refid = child.getStringAttribute("refid");
XNode includeNode = configParser.getSqlFragment(refid);
if (includeNode == null) {
String nsrefid = mapParser.applyNamespace(refid);
includeNode = configParser.getSqlFragment(nsrefid);
if (includeNode == null) {
throw new RuntimeException("Could not find SQL statement to include with refid '" + refid + "'");