A: 

In the schema, have the Node element contain zero or more child elements of type NamedEntity. In the actual document, use the xsi:type attribute (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") to choose the subtype ("Node" or "Source") for each one.

Christian Hayter
I'd rather not use xsi:type, will add that to the question.
Hanno Fietz
A: 

This may be beyond the capabilities of XSD. Have you considered doing extra validation using Schematron?

Harry Lime
+1  A: 

Please don't use xsi:type if you can avoid it. It's evil. Ok, maybe I exaggerate, but it does make it impossible to parse the document without intimate knowledge of the schema, which is bad enough in practice.

What will help you is: substitutionGroup.

bendin
Cool - learn something new every day :-). I'll bear that in mind for the future.
Christian Hayter
A: 

I think you want a substitution group.

Alastair