From Regular Expressions to Nested Words: Unifying Languages and Query Execution for Relational and XML Sequences