return nil if a matched element has no text or cdata