Whitespace driven DOM hierarchy in element generation