# Creating a user interface data model

<span class="notranslate">There are three alternative ways to implement user interface data model.</span> <span class="notranslate">The first one is to retrieve information from an XML file.</span> <span class="notranslate">Its use is simple and easy to implement during user interface prototyping phase.</span>

<span class="notranslate">A second alternative is to create a set of glue classes, similar to a DAO object, that are responsible for retrieving user interface data from the storage system, and save changes back.</span>

<span class="notranslate">Finally, there is a way to get this glue layer in a declarative way, by means of an XML behavior descriptor.</span>

<span class="notranslate">As an example, a let's build a web page for querying countries and cities, the data will be modeled by the following XML model:</span>

```XML
<?xml version = "1.0" encoding = "UTF-8">
<my-data>
 <title name = "Countries of the World" />
 <country name = "Spain" abbreviation = "en">
   <city name = "Palma de Mallorca" />
   <city name = "Madrid" />
 </country>
 <country name = "USA" abbreviation = "us">
   <city name = "Wasington" />
 </country>
 <country name = "Deutschland" abbreviation = "on">
   <city name = "Berlin" />
   <city name = "Bonn" />
   <city name = "Hamburg" />
 </country>
</my-data>
```

After creating the data model, you can make use of it from any zul page including a xmlDataSource component:

```XML
<?xml version="1.0" encoding="UTF-8">
<zk>
 <xmlDataSource id="mydata" src="/my-data.xml" />
</zk>
```