Xslang rewrite

Merging an xslang rewrite that supersedes JOPA into the master tree.