protected void generateDocumentChildren(Element root,Document doc,Tree delphiNode){
  if (root == null || doc == null) {
    return;
  }
  for (int i=0; i < delphiNode.getChildCount(); ++i) {
    Tree childNode=delphiNode.getChild(i);
    String processedName=processNodeName(childNode);
    Element child=null;
    try {
      child=doc.createElement(processedName);
    }
 catch (    DOMException e) {
      child=doc.createElement("Wrapper");
    }
    child.setTextContent(childNode.getText());
    child.setAttribute("line",String.valueOf(childNode.getLine()));
    child.setAttribute("column",String.valueOf(childNode.getCharPositionInLine()));
    child.setAttribute("class","");
    child.setAttribute("method","");
    child.setAttribute("package","");
    child.setAttribute("type",String.valueOf(childNode.getType()));
    root.appendChild(child);
    generateDocumentChildren(child,doc,childNode);
  }
}

protected void generateDocumentChildren ( Element root , Document doc , Tree delphiNode ) { if ( root == null || doc == null ) { return ; } for ( int i = 0 ; i < delphiNode . getChildCount ( ) ; ++ i ) { Tree childNode = delphiNode . getChild ( i ) ; String processedName = processNodeName ( childNode ) ; Element child = null ; try { child = doc . createElement ( processedName ) ; } catch ( DOMException e ) { child = doc . createElement ( "Wrapper" ) ; } child . setTextContent ( childNode . getText ( ) ) ; child . setAttribute ( "line" , String . valueOf ( childNode . getLine ( ) ) ) ; child . setAttribute ( "column" , String . valueOf ( childNode . getCharPositionInLine ( ) ) ) ; child . setAttribute ( "class" , "" ) ; child . setAttribute ( "method" , "" ) ; child . setAttribute ( "package" , "" ) ; child . setAttribute ( "type" , String . valueOf ( childNode . getType ( ) ) ) ; root . appendChild ( child ) ; generateDocumentChildren ( child , doc , childNode ) ; } }
generate children for specified root element from delphi node
