<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2007 IBM Corporation.
 All rights reserved.   This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html
 
 Contributors: 
 IBM - Initial API and implementation
-->

<!-- This query selects all students taught by the teacher with -->
<!-- the id: "staff01"											-->
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
	<s:itemTemplate id="teacher">
		<s:instanceIdConstraint>
			<s:instanceId>
				<s:mdrId>org.eclipse.cosmos.samples.cmdbf.XMLRepository</s:mdrId>
				<s:localId>staff01</s:localId>
			</s:instanceId>
		</s:instanceIdConstraint>
	</s:itemTemplate>
	
	<s:itemTemplate id="students">
		<s:recordConstraint>
			<s:recordType namespace="" localName="student"/>
		</s:recordConstraint>
	</s:itemTemplate>
	
	<s:relationshipTemplate id="reference">
		<s:sourceTemplate ref="teacher"/>
		<s:targetTemplate ref="students"/>
	</s:relationshipTemplate>
</s:query>