You can create an abstract complex type for your element "node" (call it abstactNode) that contains the @id definition.
Then create a complex type "nodeWithDestination" that extends abstactNode, with the definition of @destination.
The second complex type is "nodeWithActionAndViewId", which also extends abstactNode, with @action and @viewId attribute definitions.
Your XML will look like this:
<node id="id1" destination="http://www.yahoo.com" xsi:type="nodeWithDestination"/> <node id="id2" action="demo" viewId="demo.asp" xsi:type="nodeWithActionAndViewId"/>
Will this fit your needs?
source share