Extension Methods from dave thieben
if the object this method is called on is not null, runs the given function and returns the value. if the object is null, returns default(TResult).
Simply returns the value property from an XmlNode whether it's null or not. Simplifies using XmlDocuments.
optionally executes an Action if the object is of the given type.