code: public static InputStream loadResource(String resource) throws MalformedURLException, IOException{
  		String content = resource.trim();
  	    
  		// if resource is a content and not a path
  		if(!isPath(content))
  			return new ByteArrayInputStream(content.getBytes("UTF-8"));
  		
  	    URL url = Thread.currentThread().getContextClassLoader().getResource(content);
  
  	    // Could not find resource. Try with the classloader that loaded this class.
  	    if (isNull(url)) {
  	      ClassLoader classLoader = ResourceLoader.class.getClassLoader();
  	      if (classLoader != null) 
  	        url = classLoader.getResource(content);
  	      
  	    }
  
  	    // Last ditch attempt searching classpath
  	    if (isNull(url)) 
  	      url = ClassLoader.getSystemResource(content);
  	    
  	    // one more time
  	    if (isNull(url) && content.contains(":")) 
  	        url = new URL(content);
  	    
  	    if(isNull(url))
  	    	Error.xmlNotFound(content);
  	    
  	    return url.openStream();
  	}
docs: Returns an instance of inputStream if resource exists, null otherwise.
  @param resource resource to load
  @return an inputStream of resource if exists, null otherwise
  @throws MalformedURLException if url is malformed
  @throws IOException if is impossible to open the stream