XQuery is a declarative programming language which can be used to express queries and transformations of XML data. It was designed by the W3C according to a series of use cases in the area of Web data management. The goal of this paper is to explore the expressive power of XQuery as a generalpurpose programming language. To this end, this paper describes how to build an entire enterprise web application in XQuery. This paper first identifies the general requirements of a web application and then describes an appropriate implementation in XQuery. It is shown that it is actually possible and quite effective to implement a web application entirely in XQuery and that there are several advantages in doing so. The resulting code has proven to be very concise and elegant. More importantly, the use of XQuery simplifies the overall application architecture and improves flexibility.