<xsd:element name="Package" type="xpdl:PackageType">
<xsd:key name="ProcessIds.Package">
<xsd:selector xpath=".//xpdl:WorkflowProcess | .//xpdl:ActivitySet"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="PoolProcessIdRef.Package" refer="xpdl:ProcessIds.Package">
<xsd:selector xpath=".//xpdl:Pool"/>
<xsd:field xpath="@Process"/>
</xsd:keyref>
<xsd:key name="ProcessIdsTopLevel.Package">
<xsd:selector xpath=".//xpdl:WorkflowProcess"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="SubFlowIdRef.Package" refer="xpdl:ProcessIdsTopLevel.Package">
<xsd:selector xpath=".//xpdl:SubFlow"/>
<xsd:field xpath="@Id"/>
</xsd:keyref>
<xsd:key name="ActivitySetIds.Package">
<xsd:selector xpath=".//xpdl:ActivitySet"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="SubFlowStartActivitySetIdRef.Package" refer="xpdl:ActivitySetIds.Package">
<xsd:selector xpath=".//xpdl:SubFlow"/>
<xsd:field xpath="@StartActivitySetId"/>
</xsd:keyref>
<xsd:key name="ActivityIds.Package">
<xsd:selector xpath=".//xpdl:Activity"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="SubFlowStartActivityIdRef.Package" refer="xpdl:ActivityIds.Package">
<xsd:selector xpath=".//xpdl:SubFlow"/>
<xsd:field xpath="@StartActivityId"/>
</xsd:keyref>
<xsd:keyref name="TaskReferenceTaskRef.Package" refer="xpdl:ActivityIds.Package">
<xsd:selector xpath=".//xpdl:TaskReference"/>
<xsd:field xpath="@TaskRef"/>
</xsd:keyref>
<xsd:key name="LaneIds.Package">
<xsd:selector xpath=".//xpdl:Lane"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="NodeGraphicsInfoLaneIdRef.Package" refer="xpdl:LaneIds.Package">
<xsd:selector xpath=".//xpdl:NodeGraphicsInfo"/>
<xsd:field xpath="@LaneId"/>
</xsd:keyref>
<xsd:key name="PageIds.Package">
<xsd:selector xpath=".//xpdl:Page"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="GraphicsInfoPageIdRef.Package" refer="xpdl:PageIds.Package">
<xsd:selector xpath=".//xpdl:NodeGraphicsInfo | .//xpdl:ConnectorGraphicsInfo"/>
<xsd:field xpath="@PageId"/>
</xsd:keyref>
<xsd:key name="PoolAndActivityIds.Package">
<xsd:selector xpath=".//xpdl:Pool | .//xpdl:Activity"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="MessageFlowSourceRef.Package" refer="xpdl:PoolAndActivityIds.Package">
<xsd:selector xpath=".//xpdl:MessageFlow"/>
<xsd:field xpath="@Source"/>
</xsd:keyref>
<xsd:keyref name="MessageFlowTargetRef.Package" refer="xpdl:PoolAndActivityIds.Package">
<xsd:selector xpath=".//xpdl:MessageFlow"/>
<xsd:field xpath="@Target"/>
</xsd:keyref>
<xsd:key name="GlobalActivity.Package">
<xsd:selector xpath="./xpdl:GlobalActivities/xpdl:Activity"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="GlobalActivityRef.Package" refer="xpdl:GlobalActivity.Package">
<xsd:selector xpath=".//xpdl:GlobalActivityReference"/>
<xsd:field xpath="@GlobalActivityId"/>
</xsd:keyref>
<xsd:key name="DataStore.Package">
<xsd:selector xpath=".//xpdl:DataStore"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="DataStoreRef.Package" refer="xpdl:DataStore.Package">
<xsd:selector xpath=".//xpdl:DataStoreReference"/>
<xsd:field xpath="@DataStoreRef"/>
</xsd:keyref>
<xsd:key name="DataField.Package">
<xsd:selector xpath=".//xpdl:DataField"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="DataFieldRef.DataObject" refer="xpdl:DataField.Package">
<xsd:selector xpath=".//xpdl:DataObject/xpdl:DataFieldRef"/>
<xsd:field xpath="@Id"/>
</xsd:keyref>
<xsd:key name="ItemAware.Package">
<xsd:selector xpath=".//xpdl:FormalParameter | .//xpdl:DataStore | .//xpdl:DataField"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="Target.ActualParameter" refer="xpdl:ItemAware.Package">
<xsd:selector xpath=".//xpdl:ActualParameter"/>
<xsd:field xpath="@Target"/>
</xsd:keyref>
<xsd:key name="GraphicalItemAware.Package">
<xsd:selector xpath=".//xpdl:Activity | .//xpdl:DataStoreReference | .//xpdl:DataObject | .//xpdl:DataInput | .//xpdl:DataOutput | .//xpdl:Transition"/>
<xsd:field xpath="@Id"/>
</xsd:key>
<xsd:keyref name="Target.DataAssociation" refer="xpdl:GraphicalItemAware.Package">
<xsd:selector xpath=".//xpdl:DataAssociation"/>
<xsd:field xpath="@From"/>
</xsd:keyref>
<xsd:keyref name="Source.DataAssociation" refer="xpdl:GraphicalItemAware.Package">
<xsd:selector xpath=".//xpdl:DataAssociation"/>
<xsd:field xpath="@To"/>
</xsd:keyref>
<!-- checks that process id referred to by pool exists -->
<!-- checks that process id referred to by subflow exists (must be top-level, not an activityset) -->
<!-- checks that start activityset referred to by subflow exists (note: incomplete test, does not constrain to process specified by subflow) -->
<!-- checks that start activity referred to by subflow exists (note: incomplete test, does not constrain to process specified by subflow) -->
<!-- checks that activity referred to by taskreference exists (note: may be incomplete test, does not constrain to same process that contains the task) -->
<!-- checks that lane id referred to by nodegraphicsinfo exists -->
<!-- checks that page id referred to by grahicsinfo exists -->
<!-- checks that source and target referred to by messageflow exists (note: incomplete test, does check that source/target are, or are in, separate pools) -->
<!-- checks that the global activity referred by globalactivityrerence exists -->
<!-- checks that the dataStore referred by datastorereference |