If-Then Statement with DataBinding in Android

As we know we don't need to create object of our control/view when using DataBinding, but what if we want to hide some views based on a condition.
 
For example, i want to hide TextView of email when there is no data for email. Here is small code snippet for that. 
  1. <layout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:app="http://schemas.android.com/apk/res-auto"  
  3.     xmlns:tools="http://schemas.android.com/tools">  
  4.   
  5.     <data>  
  6.   
  7.         <variable  
  8.             name="user"  
  9.             type="<package name>.UserModel" />  
  10.   
  11.         <import type="android.view.View"/>  
  12.     </data>  
  13.   
  14.     <RelativeLayout  
  15.         android:layout_width="match_parent"  
  16.         android:layout_height="match_parent">  
  17.   
  18.         <TextView  
  19.              android:layout_width="wrap_content"  
  20.              android:layout_height="wrap_content"  
  21.              android:text="@{user.email}"  
  22.              android:visibility="@{user.email.trim().length()>0 ? View.VISIBLE : View.GONE}"/>  
  23.   
  24.     </RelativeLayout>  
  25. </layout>