--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ serviceResponse.rng
+
+ A schema defining the representation of the data returned in
+ response to a request. This may include a result code and
+ message, as well as a block containing any arbitrary XML-based data.
+
+ This schema was created for the CollectionSpace system,
+ http://www.collectionspace.org/
+
+ It is written in the XML syntax of the RELAX NG schema language,
+ http://relaxng.org/
+
+-->
+
+<grammar
+ xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <start>
+
+ <element
+ name="response">
+
+ <!-- ######################### -->
+ <!-- Result -->
+ <!-- ######################### -->
+
+ <!-- The result of the operation. -->
+ <element name="result">
+
+ <!--
+ A service-dependent result code, which must be
+ at least one character in length.
+ -->
+ <element name="resultCode">
+ <data type="normalizedString">
+ <param name="minLength">1</param>
+ </data>
+ </element>
+
+ <!--
+ An (optional) service-dependent message,
+ presumably corresponding to the result code.
+ -->
+ <element name="resultMessage">
+ <choice>
+ <empty/>
+ <data type="normalizedString" />
+ </choice>
+ </element>
+
+ </element>
+
+
+ <!-- ######################### -->
+ <!-- Data -->
+ <!-- ######################### -->
+
+ <!--
+ The data returned to the caller after performing the operation.
+
+ The data may be any one of the following:
+ - Empty (blank);
+ - Any text; or
+ - Any combination of elements, each of which may have attributes,
+ text nodes, and child elements.
+ -->
+
+ <!--
+ Note: we may want to add a MIME type attribute, and to consider how to
+ structure this for potentially returning multipart MIME data or the like,
+ for use cases where we might need to return multiple media objects, etc.
+ -->
+ <element name="data">
+ <choice>
+ <empty/>
+ <text/>
+ <ref name="anyElement"/>
+ </choice>
+ </element>
+
+ </element>
+
+ </start>
+
+ <!--
+ See the "Name Classes" section in the RELAX NG tutorial,
+ http://relaxng.org/tutorial-20011203.html#IDAFLZR
+ -->
+ <define name="anyElement">
+ <element>
+ <anyName/>
+ <zeroOrMore>
+ <choice>
+ <attribute>
+ <anyName/>
+ </attribute>
+ <text/>
+ <ref name="anyElement"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+
+</grammar>
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ serviceResponse.xml
+
+ A hypothetical instance of an serviceResponse document.
+
+ This document was created for the CollectionSpace system,
+ http://www.collectionspace.org/
+
+-->
+
+<!-- Note: this root element may require a namespace. -->
+<response>
+ <result>
+ <resultCode>1005</resultCode>
+ <resultMessage></resultMessage>
+ </result>
+ <!--
+ The 'data' element below may be empty, contain any text,
+ or consist of any XML element, which may have attributes,
+ text nodes, and child elements.
+ -->
+ <data>foo</data>
+</response>