function getForeignRel(elem, filename)
                        	{
                        		var fdChild = elem.firstChild;
                                
                                while (fdChild != null) 
                                {
                                    if (fdChild.nodeType == 1) 
                                    {
                                        var fdElem = fdChild;
                                        var grandchildName = fdElem.nodeName;
                                        
                                        if (grandchildName.toLowerCase() == "rel") 
                                        {
                                            var rid = fdElem.getAttribute("r:id");
                                            
                                            if (rid != null && !(rid.length === 0)) 
                                            {
                                                var index = filename.lastIndexOf('/');
                                                var pre = "";
                                                var post = "";
                                                
                                                try 
                                                {
                                                    pre = filename.substring(0, index);
                                                    post = filename.substring(index, filename.length);
                                                }
                                                catch (e) 
                                                {
                                                    return;
                                                }
                                                
                                                var relElem = model.getRelationship(rid, pre + "/_rels" + post + ".rels");
                                                
                                                if (relElem != null) 
                                                {
                                                    var target = relElem.getAttribute("Target") || "";
                                                    var type = relElem.getAttribute("Type");
                                                    index = target.lastIndexOf('/');
                                                    
                                                    try 
                                                    {
                                                        target = target.substring(index + 1, target.length);
                                                    }
                                                    catch (e) 
                                                    {
                                                        return;
                                                    }
                                                    
                                                    return {type: type, target: target};
                                                }
                                                
                                                return;
                                            }
                                        }
                                    }
                                    fdChild = fdChild.nextSibling;
                                }
                            }
Caches the specified element
@param {*} elem the element to cache
@param {com.mxgraph.io.vsdx.mxVsdxModel} model