RemexHtml/Serializer/Serializer.php
private function serializeNode( SerializerNode $parent, SerializerNode $node, $destroy ) {
		if ( $node->void ) {
			$contents = null;
		} else {
			$contents = '';
			foreach ( $node->children as $childIndex => $child ) {
				if ( is_string( $child ) ) {
					$contents .= $child;
				} else {
					$contents .= $this->serializeNode( $node, $child, $destroy );
				}
			}
		}
		if ( $destroy ) {
			unset( $this->nodes[$node->id] );
		}
		return $this->formatter->element( $parent, $node, $contents );
	}
private function serializeNode( SerializerNode $parent, SerializerNode $node, $destroy ) {
		if ( $node->void ) {
			$contents = null;
		} else {
			$contents = '';
			foreach ( $node->children as $childIndex => $child ) {
				if ( is_string( $child ) ) {
					$contents .= $child;
				} else {
					$contents .= $this->serializeNode( $node, $child, $destroy );
				}
			}
		}
		if ( $destroy ) {
			unset( $this->nodes[$node->id] );
		}
		return $this->formatter->element( $parent, $node, $contents );
	}
private function serializeNode ( SerializerNode $ parent , SerializerNode $ node , $ destroy ) { if ( $ node -> void ) { $ contents = null ; } else { $ contents = '' ; foreach ( $ node -> children as $ childIndex => $ child ) { if ( is_string ( $ child ) ) { $ contents .= $ child ; } else { $ contents .= $ this -> serializeNode ( $ node , $ child , $ destroy ) ; } } } if ( $ destroy ) { unset ( $ this -> nodes [ $ node -> id ] ) ; } return $ this -> formatter -> element ( $ parent , $ node , $ contents ) ; }
Serialize a specific node

@param SerializerNode $parent The parent of $node
@param SerializerNode $node The node to serialize
@param bool $destroy If true, the node and its descendants will be removed from $this->nodes
@return string
Serialize a specific node