diff --git a/lib/SAML2/HTTPArtifact.php b/lib/SAML2/HTTPArtifact.php
index 962a1633bef2df3b8a9769e2fd8bff26f62c3ece..958d61b00d8bbe9a1039bf2a31504df3746b4de1 100644
--- a/lib/SAML2/HTTPArtifact.php
+++ b/lib/SAML2/HTTPArtifact.php
@@ -98,7 +98,7 @@ class SAML2_HTTPArtifact extends SAML2_Binding {
 		$ar->setDestination($endpoint['Location']);
 
 		/* Sign the request */
-		sspmod_saml2_Message::addSign($this->spMetadata, $idpmetadata, $ar); // Shoaib - moved from the SOAPClient.
+		sspmod_saml_Message::addSign($this->spMetadata, $idpmetadata, $ar); // Shoaib - moved from the SOAPClient.
 
 		$soap = new SAML2_SOAPClient();
 
diff --git a/modules/exampleattributeserver/www/attributeserver.php b/modules/exampleattributeserver/www/attributeserver.php
index 4fcfa9805eec0e265a876dea1c5e8ec246f44a13..5099e7befc6c37ae9ac56cf4056ca34201fc326e 100644
--- a/modules/exampleattributeserver/www/attributeserver.php
+++ b/modules/exampleattributeserver/www/attributeserver.php
@@ -72,7 +72,7 @@ $assertion->setInResponseTo($query->getId());
 $assertion->setValidAudiences(array($spEntityId));
 $assertion->setAttributes($returnAttributes);
 $assertion->setAttributeNameFormat($attributeNameFormat);
-sspmod_saml2_Message::addSign($idpMetadata, $spMetadata, $assertion);
+sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $assertion);
 
 $response = new SAML2_Response();
 $response->setRelayState($query->getRelayState());
@@ -80,8 +80,8 @@ $response->setDestination($endpoint);
 $response->setIssuer($idpEntityId);
 $response->setInResponseTo($query->getId());
 $response->setAssertions(array($assertion));
-sspmod_saml2_Message::addSign($idpMetadata, $spMetadata, $response);
+sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $response);
 
 $binding = new SAML2_HTTPPost();
-$binding->setDestination(sspmod_saml2_Message::getDebugDestination());
+$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 $binding->send($response);
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 8d209cff2a468372c1f44fff696120bd847838e7..7ff0fa96bc560f64af212e8fd78f532209ebfc8d 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -180,7 +180,7 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 			SimpleSAML_Auth_State::throwException($state, new SimpleSAML_Error_ProxyCountExceeded("ProxyCountExceeded"));
 		}
 
-		$ar = sspmod_saml2_Message::buildAuthnRequest($this->metadata, $idpMetadata);
+		$ar = sspmod_saml_Message::buildAuthnRequest($this->metadata, $idpMetadata);
 
 		$ar->setAssertionConsumerServiceURL(SimpleSAML_Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->authId));
 
@@ -242,7 +242,7 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 
 		SimpleSAML_Logger::debug('Sending SAML 2 AuthnRequest to ' . var_export($idpMetadata->getString('entityid'), TRUE));
 		$b = new SAML2_HTTPRedirect();
-		$b->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$b->setDestination(sspmod_saml_Message::getDebugDestination());
 		$b->send($ar);
 
 		assert('FALSE');
@@ -366,13 +366,13 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 			return;
 		}
 
-		$lr = sspmod_saml2_Message::buildLogoutRequest($this->metadata, $idpMetadata);
+		$lr = sspmod_saml_Message::buildLogoutRequest($this->metadata, $idpMetadata);
 		$lr->setNameId($nameId);
 		$lr->setSessionIndex($sessionIndex);
 		$lr->setRelayState($id);
 
 		$b = new SAML2_HTTPRedirect();
-		$b->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$b->setDestination(sspmod_saml_Message::getDebugDestination());
 		$b->send($lr);
 
 		assert('FALSE');
diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index d3ae2037a093ec9f2390b0ed608320f8725f5936..611a4d88e6efa36be6f27ae4ff346482f551e629 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -45,7 +45,7 @@ class sspmod_saml_IdP_SAML2 {
 
 		$idpMetadata = $idp->getConfig();
 
-		$assertion = sspmod_saml2_Message::buildAssertion($idpMetadata, $spMetadata, $state);
+		$assertion = sspmod_saml_Message::buildAssertion($idpMetadata, $spMetadata, $state);
 		$assertion->setInResponseTo($requestId);
 		
 		if (isset($state['saml:AuthenticatingAuthority'])) {
@@ -63,10 +63,10 @@ class sspmod_saml_IdP_SAML2 {
 		);
 
 		/* Maybe encrypt the assertion. */
-		$assertion = sspmod_saml2_Message::encryptAssertion($idpMetadata, $spMetadata, $assertion);
+		$assertion = sspmod_saml_Message::encryptAssertion($idpMetadata, $spMetadata, $assertion);
 
 		/* Create the response. */
-		$ar = sspmod_saml2_Message::buildResponse($idpMetadata, $spMetadata, $consumerURL);
+		$ar = sspmod_saml_Message::buildResponse($idpMetadata, $spMetadata, $consumerURL);
 		$ar->setInResponseTo($requestId);
 		$ar->setRelayState($relayState);
 		$ar->setAssertions(array($assertion));
@@ -76,7 +76,7 @@ class sspmod_saml_IdP_SAML2 {
 
 		/* Send the response. */
 		$binding = SAML2_Binding::getBinding($protocolBinding);
-		$binding->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 		$binding->send($ar);
 	}
 
@@ -121,7 +121,7 @@ class sspmod_saml_IdP_SAML2 {
 		SimpleSAML_Logger::warning('Returning error to sp: ' . var_export($spEntityId, TRUE));
 		$error->logWarning();
 
-		$ar = sspmod_saml2_Message::buildResponse($idpMetadata, $spMetadata, $consumerURL);
+		$ar = sspmod_saml_Message::buildResponse($idpMetadata, $spMetadata, $consumerURL);
 		$ar->setInResponseTo($requestId);
 		$ar->setRelayState($relayState);
 
@@ -132,7 +132,7 @@ class sspmod_saml_IdP_SAML2 {
 		));
 
 		$binding = SAML2_Binding::getBinding($protocolBinding);
-		$binding->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 		$binding->send($ar);
 	}
 
@@ -246,7 +246,7 @@ class sspmod_saml_IdP_SAML2 {
 			}
 			$spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote');
 
-			sspmod_saml2_Message::validateMessage($spMetadata, $idpMetadata, $request);
+			sspmod_saml_Message::validateMessage($spMetadata, $idpMetadata, $request);
 
 			$relayState = $request->getRelayState();
 
@@ -360,7 +360,7 @@ class sspmod_saml_IdP_SAML2 {
 		$idpMetadata = $idp->getConfig();
 		$spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote');
 
-		$lr = sspmod_saml2_Message::buildLogoutResponse($idpMetadata, $spMetadata);
+		$lr = sspmod_saml_Message::buildLogoutResponse($idpMetadata, $spMetadata);
 		$lr->setInResponseTo($state['saml:RequestId']);
 		$lr->setRelayState($state['saml:RelayState']);
 
@@ -375,7 +375,7 @@ class sspmod_saml_IdP_SAML2 {
 		}
 
 		$binding = new SAML2_HTTPRedirect();
-		$binding->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 		$binding->send($lr);
 	}
 
@@ -400,7 +400,7 @@ class sspmod_saml_IdP_SAML2 {
 		$idpMetadata = $idp->getConfig();
 		$spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote');
 
-		sspmod_saml2_Message::validateMessage($spMetadata, $idpMetadata, $message);
+		sspmod_saml_Message::validateMessage($spMetadata, $idpMetadata, $message);
 
 		if ($message instanceof SAML2_LogoutResponse) {
 
@@ -409,7 +409,7 @@ class sspmod_saml_IdP_SAML2 {
 			$relayState = $message->getRelayState();
 
 			if (!$message->isSuccess()) {
-				$logoutError = sspmod_saml2_Message::getResponseError($message);
+				$logoutError = sspmod_saml_Message::getResponseError($message);
 				SimpleSAML_Logger::warning('Unsuccessful logout. Status was: ' . $logoutError);
 			} else {
 				$logoutError = NULL;
@@ -460,7 +460,7 @@ class sspmod_saml_IdP_SAML2 {
 		$idpMetadata = $idp->getConfig();
 		$spMetadata = $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote');
 
-		$lr = sspmod_saml2_Message::buildLogoutRequest($idpMetadata, $spMetadata);
+		$lr = sspmod_saml_Message::buildLogoutRequest($idpMetadata, $spMetadata);
 		$lr->setRelayState($relayState);
 		$lr->setSessionIndex($association['saml:SessionIndex']);
 		$lr->setNameId($association['saml:NameID']);
diff --git a/modules/saml2/lib/Message.php b/modules/saml/lib/Message.php
similarity index 99%
rename from modules/saml2/lib/Message.php
rename to modules/saml/lib/Message.php
index 5b46fcdf51b2606ef60386d2195767e56a11740c..6184d248285f1fd8924c470e35a7e10e1501c29d 100644
--- a/modules/saml2/lib/Message.php
+++ b/modules/saml/lib/Message.php
@@ -8,7 +8,7 @@
  * @package simpleSAMLphp
  * @version $Id$
  */
-class sspmod_saml2_Message {
+class sspmod_saml_Message {
 
 	/**
 	 * Retrieve the destination we should send the message to.
diff --git a/modules/saml/www/sp/saml2-acs.php b/modules/saml/www/sp/saml2-acs.php
index 4c7160169f95b5f4f3d6c03efecdb699aadbe5ef..d95c7eb49b365242cf1cd532aa9210a206313f99 100644
--- a/modules/saml/www/sp/saml2-acs.php
+++ b/modules/saml/www/sp/saml2-acs.php
@@ -47,7 +47,7 @@ SimpleSAML_Logger::debug('Received SAML2 Response from ' . var_export($idp, TRUE
 $idpMetadata = $source->getIdPmetadata($idp);
 
 try {
-	$assertion = sspmod_saml2_Message::processResponse($spMetadata, $idpMetadata, $response);
+	$assertion = sspmod_saml_Message::processResponse($spMetadata, $idpMetadata, $response);
 } catch (sspmod_saml2_Error $e) {
 	/* The status of the response wasn't "success". */
 	$e = $e->toException();
diff --git a/modules/saml/www/sp/saml2-logout.php b/modules/saml/www/sp/saml2-logout.php
index 0ec6704c470f427dff066732a2db21f8c4d0378c..e1777157cc0363b70a990fc0df09d9e188ffb7a3 100644
--- a/modules/saml/www/sp/saml2-logout.php
+++ b/modules/saml/www/sp/saml2-logout.php
@@ -35,7 +35,7 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 $idpMetadata = $source->getIdPMetadata($idpEntityId);
 $spMetadata = $source->getMetadata();
 
-sspmod_saml2_Message::validateMessage($idpMetadata, $spMetadata, $message);
+sspmod_saml_Message::validateMessage($idpMetadata, $spMetadata, $message);
 
 if ($message instanceof SAML2_LogoutResponse) {
 
@@ -46,7 +46,7 @@ if ($message instanceof SAML2_LogoutResponse) {
 	}
 
 	if (!$message->isSuccess()) {
-		SimpleSAML_Logger::warning('Unsuccessful logout. Status was: ' . sspmod_saml2_Message::getResponseError($message));
+		SimpleSAML_Logger::warning('Unsuccessful logout. Status was: ' . sspmod_saml_Message::getResponseError($message));
 	}
 
 	$state = SimpleSAML_Auth_State::loadState($relayState, 'saml:slosent');
@@ -61,12 +61,12 @@ if ($message instanceof SAML2_LogoutResponse) {
 	$source->handleLogout($idpEntityId);
 
 	/* Create an send response. */
-	$lr = sspmod_saml2_Message::buildLogoutResponse($spMetadata, $idpMetadata);
+	$lr = sspmod_saml_Message::buildLogoutResponse($spMetadata, $idpMetadata);
 	$lr->setRelayState($message->getRelayState());
 	$lr->setInResponseTo($message->getId());
 
 	$binding = new SAML2_HTTPRedirect();
-	$binding->setDestination(sspmod_SAML2_Message::getDebugDestination());
+	$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 	$binding->send($lr);
 } else {
 	throw new SimpleSAML_Error_BadRequest('Unknown message received on logout endpoint: ' . get_class($message));
diff --git a/www/example-simple/attributequery.php b/www/example-simple/attributequery.php
index 94e6a9d7b322653f967ceb34f0c62bb26a5f5f17..1bd04410d58130914ba30d3808cb08ab0646fdc3 100644
--- a/www/example-simple/attributequery.php
+++ b/www/example-simple/attributequery.php
@@ -21,7 +21,7 @@ function sendQuery($dataId, $url, $nameId) {
 	$query->setNameId($nameId);
 
 	$binding = new SAML2_HTTPRedirect();
-	$binding->setDestination(sspmod_saml2_Message::getDebugDestination());
+	$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 	$binding->send($query);
 }
 
@@ -47,7 +47,7 @@ function handleResponse() {
 	$idpMetadata = $GLOBALS['metadata']->getMetaDataConfig($idpEntityId, 'saml20-idp-remote');
 	$spMetadata =  $GLOBALS['metadata']->getMetaDataConfig($GLOBALS['spEntityId'], 'saml20-sp-hosted');
 
-	$assertion = sspmod_saml2_Message::processResponse($spMetadata, $idpMetadata, $response);
+	$assertion = sspmod_saml_Message::processResponse($spMetadata, $idpMetadata, $response);
 
 	$dataId = $response->getRelayState();
 	if ($dataId === NULL) {
diff --git a/www/saml2/sp/AssertionConsumerService.php b/www/saml2/sp/AssertionConsumerService.php
index bfe0c7766719c60642816901403d26e54d14e680..2446a26e8201e1e3f6d8ad622ef844c32c4b0a2b 100644
--- a/www/saml2/sp/AssertionConsumerService.php
+++ b/www/saml2/sp/AssertionConsumerService.php
@@ -104,7 +104,7 @@ try {
 
 
 	try {
-		$assertion = sspmod_saml2_Message::processResponse($spMetadata, $idpMetadata, $response);
+		$assertion = sspmod_saml_Message::processResponse($spMetadata, $idpMetadata, $response);
 	} catch (sspmod_saml2_Error $e) {
 		/* The status of the response wasn't "success". */
 
diff --git a/www/saml2/sp/SingleLogoutService.php b/www/saml2/sp/SingleLogoutService.php
index bd870327ba29f710a0ad8ee1566016926a9f463b..9a07973e0ef01201023fc2dcac841cc67b0ffe9b 100644
--- a/www/saml2/sp/SingleLogoutService.php
+++ b/www/saml2/sp/SingleLogoutService.php
@@ -34,7 +34,7 @@ $spEntityId = $metadata->getMetaDataCurrentEntityId('saml20-sp-hosted');
 $idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-remote');
 $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-hosted');
 
-sspmod_saml2_Message::validateMessage($idpMetadata, $spMetadata, $message);
+sspmod_saml_Message::validateMessage($idpMetadata, $spMetadata, $message);
 
 if ($message instanceof SAML2_LogoutRequest) {
 
@@ -47,7 +47,7 @@ if ($message instanceof SAML2_LogoutRequest) {
 		SimpleSAML_Logger::stats('saml20-idp-SLO idpinit ' . $spEntityId . ' ' . $idpEntityId);
 
 		/* Create response. */
-		$lr = sspmod_saml2_Message::buildLogoutResponse($spMetadata, $idpMetadata);
+		$lr = sspmod_saml_Message::buildLogoutResponse($spMetadata, $idpMetadata);
 		$lr->setRelayState($message->getRelayState());
 		$lr->setInResponseTo($message->getId());
 
@@ -55,7 +55,7 @@ if ($message instanceof SAML2_LogoutRequest) {
 
 		/* Send response. */
 		$binding = new SAML2_HTTPRedirect();
-		$binding->setDestination(sspmod_SAML2_Message::getDebugDestination());
+		$binding->setDestination(sspmod_saml_Message::getDebugDestination());
 		$binding->send($lr);
 	} catch (Exception $exception) {
 		SimpleSAML_Utilities::fatalError($session->getTrackID(), 'LOGOUTREQUEST', $exception);
diff --git a/www/saml2/sp/initSLO.php b/www/saml2/sp/initSLO.php
index 7228d57694bf68e55348b0ecbdc609e741665404..16b188ccd9ccfe6fb25a03d892dc8dec0ebd49ab 100644
--- a/www/saml2/sp/initSLO.php
+++ b/www/saml2/sp/initSLO.php
@@ -40,7 +40,7 @@ try {
 
 	$nameId = $session->getNameId();
 
-	$lr = sspmod_saml2_Message::buildLogoutRequest($spMetadata, $idpMetadata);
+	$lr = sspmod_saml_Message::buildLogoutRequest($spMetadata, $idpMetadata);
 	$lr->setNameId($nameId);
 	$lr->setSessionIndex($session->getSessionIndex());
 
@@ -52,7 +52,7 @@ try {
 	SimpleSAML_Logger::info('SAML2.0 - SP.initSLO: SP (' . $spEntityId . ') is sending logout request to IdP (' . $idpEntityId . ')');
 
 	$b = new SAML2_HTTPRedirect();
-	$b->setDestination(sspmod_SAML2_Message::getDebugDestination());
+	$b->setDestination(sspmod_saml_Message::getDebugDestination());
 	$b->send($lr);
 
 
diff --git a/www/saml2/sp/initSSO.php b/www/saml2/sp/initSSO.php
index 4146d103f68c210fd4a3aade32ac5c54b0b57ded..a75a4b4414515c4bfb10f1e3d0b76e385b7d7bcd 100644
--- a/www/saml2/sp/initSSO.php
+++ b/www/saml2/sp/initSSO.php
@@ -132,7 +132,7 @@ try {
 	$spMetadata = $metadata->getMetaDataConfig($spentityid, 'saml20-sp-hosted');
 	$idpMetadata = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-remote');
 
-	$ar = sspmod_saml2_Message::buildAuthnRequest($spMetadata, $idpMetadata);
+	$ar = sspmod_saml_Message::buildAuthnRequest($spMetadata, $idpMetadata);
 
 	$assertionConsumerServiceURL = $metadata->getGenerated('AssertionConsumerService', 'saml20-sp-hosted');
 	$ar->setAssertionConsumerServiceURL($assertionConsumerServiceURL);
@@ -165,7 +165,7 @@ try {
 	$session->setData('SAML2:SP:SSO:Info', $ar->getId(), $info);
 
 	$b = new SAML2_HTTPRedirect();
-	$b->setDestination(sspmod_SAML2_Message::getDebugDestination());
+	$b->setDestination(sspmod_saml_Message::getDebugDestination());
 	$b->send($ar);
 
 } catch(Exception $exception) {