This code is more succict and correctly allows the developer to specify XML pages as well as HTML should they desire.