bug fix: only captures values which are not nil will now be added as attributes to an XML element.