Unique combination of sets We start with a finite number of $N$ sets, $\boldsymbol{X}_1,\ldots,\boldsymbol{X}_N$, each containing a finite number of integers. The sets do not in general have the same number of elements. The goal is to find all possible unique combination that you can get by taking the union of some of these sets. All sets need to be used.
Example for $N = 4$ the possible combinations are:


*

*$\boldsymbol{X}_1,\boldsymbol{X}_2,\boldsymbol{X}_3, \boldsymbol{X}_4$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_2),\boldsymbol{X}_3, \boldsymbol{X}_4$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_2),(\boldsymbol{X}_3 \bigcup\boldsymbol{X}_4)$

*$\boldsymbol{X}_1,\boldsymbol{X}_2,(\boldsymbol{X}_3 \bigcup\boldsymbol{X}_4)$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_3),\boldsymbol{X}_2,\boldsymbol{X}_4$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_3),(\boldsymbol{X}_2\bigcup\boldsymbol{X}_4)$

*$\boldsymbol{X}_1,\boldsymbol{X}_3,(\boldsymbol{X}_2\bigcup\boldsymbol{X}_4)$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_4),\boldsymbol{X}_2,\boldsymbol{X}_3$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_4),(\boldsymbol{X}_2\bigcup\boldsymbol{X}_3)$

*$\boldsymbol{X}_1,\boldsymbol{X}_4,(\boldsymbol{X}_2\bigcup\boldsymbol{X}_3)$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_2\bigcup\boldsymbol{X}_3),\boldsymbol{X}_4$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_2\bigcup\boldsymbol{X}_4),\boldsymbol{X}_3$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_3\bigcup\boldsymbol{X}_4),\boldsymbol{X}_2$

*$\boldsymbol{X}_1,(\boldsymbol{X}_2\bigcup\boldsymbol{X}_3\bigcup\boldsymbol{X}_1)$

*($\boldsymbol{X}_1\bigcup\boldsymbol{X}_2\bigcup\boldsymbol{X}_3\bigcup\boldsymbol{X}_1$)


This could be encoded in a matrix as:
$\begin{bmatrix}0,0,0,0\\1,1,0,0\\1,1,2,2\\0,0,1,1\\1,0,1,0\\1,2,1,2\\0,1,0,1\\1,0,0,1\\1,2,2,1\\0,1,1,0\\1,1,1,0\\1,1,0,1\\1,0,1,1\\0,1,1,1\\1,1,1,1\end{bmatrix}$,
where each column corresponds with a set and each row with a combination; a $0$ indicates that the set is not combined with any other set and $1$, $2$, etc. indicates a union of the sets with the same number.
How do I generate this sequence in general (for my particular application I expect $N<20$). Can anyone point me in the right direction? 

I would generate the partitions of $N$.  For $4$, they are $4, 3+1, 2+2, 2+1+1, 1+1+1+1$, then assign that many sets to each partition.  The $4$ corresponds to your combination $15$.  For $3+1$ there are four ways to choose the $3$, giving your combinations $11,12,13,14$.  When you have multiple partitions of the same size, you need some way not to repeat, like saying the lowest number set in any of those is in the first partition.  Then $2+2$ gives $3,6,9$ and so on.
