XForms is a relatively recent standard from the W3C, designed to allow us to create sophisticated user interfaces using mark-up. This means that defining a user interface is much the same as using HTML, except that XForms has been designed from the ground up to cope with many of the things that we usually have to dive into script to do.
And XForms doesn't just make it easy to replace script in our applications, it also provides us with the means to manipulate and validate XML; unlike most languages that you might have used, XForms brings XML right into the heart of the language.
In this section we'll look at some of the things you can do with XForms, but if you want to jump right in and look at some mark-up, feel free to skip to Feet First...Some Basics
XForms makes it very easy to create dependencies between different parts of a web application. Of major significance is that these dependencies are established at the level of the data, before being reflected in the user interface. For example, say a form contains a data value for 'number of years at the current address' and another for 'previous address'; a rule could be created that says the latter need not be completed if the form-filler has been at their current address for less than three years.
In XForms this rule is defined completely independently of the actual user interface itself, but the XForms processor will ensure that any form control that is representing the 'previous address' fields will only be made relevant (i.e., available for the user to fill in), once the correct conditions are met.
It's also possible to define a rule that says the 'previous address' field is required if the form-filler has only lived at their current address for a certain amount of time. An XForms processor can prevent the form from being submitted to the server, if this condition is not met.
Since these 'business rules' are defined using a standard mark-up language and XPath statements, they become very easy to develop, maintain, and test. This is because, unlike traditional e-forms systems where such rules are tightly coupled with the user interface, in XForms there is a separate data layer within which the logic sits. (XForms was designed to make use of the Model-View-Controller pattern.)
In the following screenshot from the mortgage application sample (see the showcase area) a user has indicated that the purpose of the mortgage they are applying for is to buy a bungalow:
However, when the selection is changed to indicate the purchase of a flat, three further fields automatically become available to the user, to allow the capture of more information:

Since data-entry fields can be shown and hidden as other data is entered, it is important to provide some sort of indication to the user that the form has changed--particularly on large forms. formsPlayer makes various highlighting features available to the form author in a simple and concise way.
In the following screenshot we can see two highlighting techniques being employed at the same time; one is a yellow highlight that lasts for 2 seconds, and indicates to the user that some controls that were not previously available are now available, whilst the second technique draws the user's attention to some status information that is shown in green, for about 8 seconds:

Once the highlights have timed out, the form looks like this:

XForms allows us to define both the conditions for the highlighting and the highlighting itself in simple mark-up, and it is easy to add other effects--for example, a red background when a control becomes invalid.
Routing is a similar concept to relevance. However, XForms allows quite complex routing between form controls. For example, on a large form with many pages, it is often the case that to fix an error in one page the user needs to navigate back to a previous page. The HTML-like mark-up employed by XForms allows these types of relationships to easily be established.
In the following screenshot two form controls are in effect linked together since for them both to be valid, the length of time remaining on a lease cannot be greater than the full term of the lease:

However, if there is an error the user may not choose to correct the nearest control since the fault may be with the other part of the 'pair'. For example, if the full term of the lease was set to 60, and the remaining term set to 65, it's difficult to which of the two values is in error. To make things easier for the user, the form includes 'shortcuts' to the 'other' control; in the error messages below (only shown when the data is invalid) the text with the light blue background refers to the 'matching' control, and clicking on it causes the focus to be set to that form control:

In this example the controls are close by, but in a very large form this technique can greatly assist the user.
XForms provides extremely powerful mechanisms for providing help to users, both in the form of tooltips as well as [F1]-style help. Importantly, XForms has evolved to correct many of the limitations of current forms technologies, and allows for fully internationalised and accessible hints. In the following screenshot an XForms hint is used to show an image as well as formatted text:

Hints can also be multimodal--formsPlayer supports delivering hints and other messages using voice technology:

One other point worth drawing attention to is that XForms provides a mechanism for items such as hints and help (as well as error messages and form control labels) to be provided by external XML files, making it extremely easy to first define the structure and logic of a form, and then to 'drop in' any number of alternative files. This allows the same form to be provided to users who speak different languages.
XForms allows for many different types of data submission, providing an enormous degree of flexibility when talking to back-end systems. Data can be submitted in formats ranging from pure XML, to XML with embedded data (such as images or Word documents), through to the simple serialisation of name/value pairs. (This latter feature allows XForms to communicate with server-side systems that were designed to be used with HTML forms.)
In addition to this wide range of possible data formats, XForms also supports a variety of protocols. This means that XForms not only allows for data to be transferred using HTTP, but can also cope with the saving and loading of local files, as well as transferring data via email and even saving to local ODBC databases.
XForms has been designed to be platform independent, and processors for different devices are emerging. For example, organisations such as IBM are working on the use of voice with XForms, allowing the same form to be used unchanged on both a desktop PC and a touch-tone phone system.
x-port have a number of initiatives underway in this area, ranging from the user of voice prompts in forms, through to the development of Pocket PC and Mac versions of formsPlayer.