Use a regular expression pattern to parse various xml content types

and simplify the boolean expression to use less nesting, ie just
checking and not this, and not that, etcetera.