But my question is how to check "xyz" with "name" attribute value "all" always come first and optional.
You can't do this with XSD 1.0. The grammar defined for a complex type only constraints elements in the sequence by their element name, not by their content, and the rules for the content of an element cannot differ for two sibling elements with the same name.
You can do it, of course, with XSD 1.1 assertions. For example, a constraint at the level of the containing abc element of the form assert="not(xyz[@name='all']/preceding-sibling::*)"
.
XSD 1.1 is currently implemented only in Saxon and Xerces.