void buildMarkdown ( Node parent ) throws InvalidInputException { for ( Element child : this . children ) { Node node = child . asMarkdown ( ) ; if ( node != null ) { parent . appendChild ( node ) ; } else { node = parent ; } child . buildMarkdown ( node ) ; } }
Traverse the element and its children to construct its representation as a Markdown tree .