Function markup-str to traverse the markup tree and create the markup string