<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="CalVal">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="SensorID">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="MxAssetID" type="xs:unsignedLong" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="StreamCalVal"  maxOccurs="unbounded" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CalFixture"  maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="CalFixtureID"  maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="ActivityLocation"  maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="SWVersion"  maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="ProcedureVersion"  maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="Station"  maxOccurs="unbounded" minOccurs="0"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="CalEnvironment"  maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="AmbientTemperature"  maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Min" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Max" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Mean" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="StdDev" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="AmbientPressure"  maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Min" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Max" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Mean" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="StdDev" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="AmbientHumidity"  maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Min" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Max" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="Mean" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                          <xs:element name="StdDev" type="xs:decimal"  maxOccurs="unbounded" minOccurs="0"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="CalibrationCoefficient" maxOccurs="unbounded" minOccurs="1" >
                <xs:complexType>
                  <xs:sequence>
                   <xs:element type="xs:string" name="Name" maxOccurs="unbounded" minOccurs="1"/>
                   <xs:element name="Value" type="xs:string" maxOccurs="unbounded" minOccurs="1"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
			  <xs:element name="CalibrationTable" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Metadata"  maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Entry">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element type="xs:string" name="Name"/>
                                <xs:element type="xs:string" name="Value"/>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Row"  maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Independent">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute type="xs:string" name="name"/>
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="Column"  maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="Dependent">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute type="xs:string" name="name"/>
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute type="xs:string" name="index"/>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute type="xs:string" name="index"/>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute type="xs:string" name="name"/>
                </xs:complexType>
              </xs:element>
		      <xs:element name="CalibrationStandards"  maxOccurs="unbounded" minOccurs="0" >
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="CertNumber" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
	          <xs:element name="StreamID" type="xs:unsignedByte" />
              <xs:element maxOccurs="unbounded" name="Uncertainty">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Name" type="xs:string" />
                    <xs:element name="Value" type="xs:decimal" />
                  </xs:sequence>
                  <xs:attribute name="units" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="Trueness"  maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:decimal">
                      <xs:attribute name="units" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="ActivityTimeRange" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="StartTime" type="xs:dateTime" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element name="EndTime" type="xs:dateTime" maxOccurs="unbounded" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="CertificateNumber" type="xs:unsignedLong" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ValidTimeRange">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="StartTime" type="xs:dateTime" />
              <xs:element name="EndTime" type="xs:dateTime" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Comment">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CommentDescription" type="xs:string" />
              <xs:element name="CommentCreator" type="xs:string" />
              <xs:element type="xs:string" name="CommentDateTime"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="DATA">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="MetaData">
                <xs:complexType>
                  <xs:sequence>
 			          		<xs:element type="xs:string" name="Equipment" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="Operator" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="WorkOrder" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:integer" name="MaximoID"/>
                    <xs:element type="xs:long" name="AssetID"/>
                    <xs:element type="xs:string" name="Reference" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="Fixture" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element type="xs:string" name="NEONPN" maxOccurs="unbounded" minOccurs="0"/>
                    <xs:element name="SN" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="header"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="FW" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="header"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="SOH" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="header"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element type="xs:string" name="UncertaintyCtl" maxOccurs="unbounded" minOccurs="0"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="PreCALDATA" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute type="xs:string" name="header"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="CALDATA">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="header" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
			  <xs:element name="ValidationDATA" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute type="xs:string" name="header"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="QCStatic">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="header" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
			  <xs:element name="QCDynamic">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="header" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element> 
			  
              <xs:element name="Precision">
                <xs:complexType>
                  <xs:attribute name="header" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="AsLeftCFG" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute type="xs:string" name="header"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="AsReceived" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="ReceivedCFG" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="header"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ReceivedCoefficient" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element type="xs:string" name="Name"/>
                          <xs:element type="xs:string" name="Value"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ReceivedDATA" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:string" name="header"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                 </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
