Formalizing html structure