1066 provide xml for logics

Should at least be a partial-fix for #1066 and #32. It should be decided by @tillmo whether to merge this and if one or the other (or both) issues should be closed afterwards.
Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.