You may also consider using filter_var($string, FILTER_VALIDATE_BOOLEAN) to convert the value to boolean (for example it will also convert "1" or "yes" to a boolean), depending on the type of value you'll get in the XML.