abstract class DomBuilder { DomBuilderElement append( String tagName, void Function(DomBuilderElement) f); void text(String value); } abstract class DomBuilderElement extends DomBuilder { void attr(String name, [String value]); void attrs(Map map); T close(); }