private function getSignedXml()
 {
     $doc = new \DOMDocument();
     $doc->appendChild($doc->createElement('root'));
     /** @var $root \DOMElement */
     $root = $doc->firstChild;
     $root->setAttribute('foo', 'bar');
     $other = $doc->createElement('other');
     $root->appendChild($other);
     $child = $doc->createElement('child', 'something');
     $other->appendChild($child);
     $certificate = new X509Certificate();
     $certificate->loadFromFile(__DIR__ . '/../../../../../../../resources/sample/Certificate/saml.crt');
     $key = new \XMLSecurityKey(\XMLSecurityKey::RSA_SHA1, array('type' => 'private'));
     $key->loadKey(__DIR__ . '/../../../../../../../resources/sample/Certificate/saml.pem', true);
     $signatureCreator = new SignatureCreator();
     $signatureCreator->setCertificate($certificate);
     $signatureCreator->setXmlSecurityKey($key);
     $context = new SerializationContext($doc);
     $signatureCreator->getXml($root, $context);
     $xml = $doc->saveXML();
     return $xml;
 }