How can I specify an XML schema for an instance document like this:
In VS, reports an error: Elements with the same name and in the same scope must have the same type.
I think XSD can't fullfill your requirement, you can try to solve it from another direction.for example, use xslt to validate XML. XSLT is xpath based and rule based, it can check every places in xml.
XSD + XSLT is a good solution, XSD for schema check, XSLT for information check.