On the web, media tend to be encoded in declarative formats, which facilitate accessibility, reuse, and transformation. Web applications, on the other hand, are created with more procedural technology and do not enjoy these benefits. In this thesis we examine how this can be fixed. We examine a small part of the problem space, adaptive time based applications, and investigate how we can extend existing declarative languages to facilitate these. We develop a mechanism, SMIL State, which enables SMIL to be used to create such applications, either by itself or integrated with other declarative components. The mechanism is then evaluated in its target application area. We then return to the larger problem area, and show that there are opportunities for applying similar techniques. This should eventually enable the creation of web applications that are more integrated in the web as a whole, by being searchable, accessible, transformable and reusable.