As the title states I want to save a tabularx in a box. Usually I would use this approach to save it in a box and later on typeset it. But the problem is that want to use it in an environment.
So the naive approach which works with tabular, but not tabularx would be:
\documentclass{article}
\usepackage{xparse}
\usepackage{tabularx}
\newsavebox{\mybox}
\ExplSyntaxOn
\NewDocumentEnvironment{strange}{}
{
\begin{lrbox}{\mybox}
\tabularx{\textwidth}{|l|ll|}
}
{
\endtabularx
\end{lrbox}
}
\ExplSyntaxOff
\begin{document}
\begin{strange}
x & y & z\\\hline
\end{strange}
\end{document}
Question: Is it even possible to get a tabularx saved into a box, and if yes, how?
I'm adding the expl3 tag here, because this environment will be defined in expl3 context. So any solution with l3box is appreciated too.

%(although that's unrelated to the question here) – David Carlisle Jan 05 '18 at 11:42strangeenvironment this is ;-) – Jan 05 '18 at 11:44