My XSD structure is like the below:-
>
I voted up gbvb's answer.
I don't understand why do you want this but.
The empty element with xmlns:xsi and xsi:nil is the right way to go.
Without those attributes any reasonable parsers will give you the empty string even if the element is self-closed.
Say you want to give clients an integer value which means the highest score in many players' scores.
When you can calculate you can give the right value.
When there is no player who actually scored yet, you should the right value as NULL or nil which means there is no record accumulated.
98
Can be said the highest score is 98 of of 128 tries.
And
Can be said there is no highest score because there is no scores recorded.
But
Doesn't mean anything but a simple self-closed empty element.