public static function TypeCodeForXmlType( $xmlType )
	{
		// Sanity check
		if ( is_null( $xmlType ) || ! is_scalar( $xmlType ) )
		{
			return XmlTypeCode::UntypedAtomic;
		}

		$types = SchemaTypes::getInstance();
		$atom = $types->getAtomicType( $xmlType );

		return isset( XmlTypeCode::$typeToCodeMap[ $atom ] )
			? XmlTypeCode::$typeToCodeMap[ $atom ]
			: XmlTypeCode::UntypedAtomic;
	}