source: class SPIDIntegrationUtil {
  
  	public Element xmlStringToElement(String xmlData) throws SAXException, IOException, ParserConfigurationException {
  		InputStream xmlByteArrayInputStream = new ByteArrayInputStream(xmlData.getBytes());
  		Element node = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlByteArrayInputStream).getDocumentElement();
  
  		return node;
  	}
  
  	public  SPIDIntegrationUtil();
  
  	public String encodeAndPrintAuthnRequest(AuthnRequest authnRequest);
  	public String printAuthnRequest(AuthnRequest authnRequest);
  	public Credential getCredential();
  	public KeyStore getKeyStore();
  	public Signature getSignature();
  
        @Autowired
        private SPIDIntegrationUtil spidIntegrationUtil;
  
  }
  
  class SPIDIntegrationUtilTest {
  
        @Autowired
        private SPIDIntegrationUtil spidIntegrationUtil;
  
        @Test
        public void xmlStringToXMLObjectTest() {
  
target: 
              ClassLoader classLoader = getClass().getClassLoader();
              File xmlFile = new File(classLoader.getResource("metadata/idp/telecom-metadata.xml").getFile());
              try (Scanner scanner = new Scanner(xmlFile)) {
                    String xmlData = scanner.useDelimiter("\\Z").next();
                    Element node = spidIntegrationUtil.xmlStringToElement(xmlData);
  
                    Assert.assertEquals("md:EntityDescriptor", node.getNodeName());
  
              } catch (SAXException | IOException | ParserConfigurationException e) {
                    e.printStackTrace();
                    Assert.fail();
              }
        }
  
  }