How exactly does Halmos define an ordered pair? Halmos writes in "Naive Set Theory":

Given the set ${X}$, consider the collection $W$ of all well-ordered subsets of $X$. Explicitly: an elememt of $W$ is a subset $A$ of $X$ together with a well ordering of $A$. We partially order $W$ by continuation.

Then he goes on and writes:

The collection $W$ is not empty, because, for instance $\emptyset\, 
 \epsilon \,W$. If $X \neq \emptyset$, less annoying elements of $W$ can be exhibited; one such is {($x, x$)}, for any particular element $x$ of $X$.

My problem is that Halmos defined earlier in section 6 about Ordered Pairs that an ordered pair is defined as follows:
$(a, b) = \{\, \{a\}, \{a, b\}\}$.
And if $a=b$ then we have
$(x,x)= \{\{x\}\}$.
My problem/question is that if $W$ contains subsets of $X$ and if $x$ is an element of $X$, then why is
{($x, x$)} in $W$? By the definition of an ordered pair that Halmos gave we can only conclude that $(x,x)\, \epsilon \,W$.
 A: I think Halmos contradicts himself here.
It is a fact that given a well-ordering of a set, you can retrieve the set from the well-ordering. So it would be natural to define $W$ as the set of well-orderings on subsets of $X$. With this understanding, $\{(x,x)\}$ is a well-ordering (in fact the only well-ordering) of the set $A=\{x\}$, so it would indeed be an element of $W$ (and is equal to $\{\{\{x\}\}\}$, as you say).
But he explicitly defines an element of $W$ as a subset $A\subset  X$ together with a well-ordering of $A$. Exactly what "together with" means here is not perfectly clear, but a natural interpretation would be the ordered pair consisting of $A$ and a well-ordering of $A$. And in this case $\{(x,x)\}$ is not an element of $W$; rather you would need $(\{x\},\{(x,x)\})$.
A: It seems that a "well-ordered set" means just a well-ordering relation.
That is, when we would normally write $(E,R)$ where $E$ is the set and $R$ is the order relation on $E$, in fact it is enough to write only $R$ (since we can recover $E$ from $R$).  So, for example, $R=\{(x,x)\}$ is the unique well order relation on the set $\{x\}$, so (in this understanding) $R$ is a well-ordered set.
