The coding language of next generation WAP/mobile services is XHTML, but Nokia phones still support also WML, so existing WML applications can be used.
One way to detect the browser is by the user name in the HTTP header. From that you'll know exactly which browser is approaching you server.
Hi, the browser can be identified from the user agent field, which is sent in the HTTP header when the client fetches content from the origin server. You can use the user agent field to define the type of the browser and then build logic on the origin server to serve suitable content. You need to use some scritping language, like JSP, ASP or Perl. There are a lot of example codes for detecting the client in the Web available. Just make a search with "device recognition" or similar.
Perhaps a better way to determine the types of files you may serve to a browser is by using the HTTP_ACCEPTS header, which will tell you straight if the browser accepts (x)html / wml etc.