Handle case where Feature booleans are 'true' or 'false' during parsing

I've come across a few kml documents that use string 'true' or 'false' for the visibility and open boolean values instead of 1 or 0.  The current way of casting to int doesn't work for these.  The changes I made check for the string values and force to integer 1 or 0. 

I'm not sure this is the best solution as it doesn't preserve the original string values when using to_string, but it works for my needs.  I thought this might be useful for others as well.
According to kml reference the default values here are:
visibility=1
open=0

And according to xsd definition for boolean:
Legal values for boolean are true, false, 1 (which indicates true), and 0 (which indicates false).

Refs:
https://developers.google.com/kml/documentation/kmlreference#feature
http://www.w3schools.com/schema/schema_dtypes_misc.asp