private Object getXmlObjectFromXmlSubnet(String id, XmlSubnet xmlSubnet) {
        for (XmlPlace xmlPlace : xmlSubnet.places) {
            if (xmlPlace.id.equals(id)) {
                return xmlPlace;
            }
        }
        for (XmlTransition xmlTransition : xmlSubnet.transitions) {
            if (xmlTransition.id.equals(id)) {
                return xmlTransition;
            }
        }
        for (XmlReferencePlace xmlReference : xmlSubnet.referencePlaces) {
            if (xmlReference.id.equals(id)) {
                return xmlReference;
            }
        }
        for (XmlSubnet xmlSubSubnet : xmlSubnet.subnets) {
            if (xmlSubSubnet.id.equals(id)) {
                return xmlSubSubnet;
            }
            Object xmlObject = getXmlObjectFromXmlSubnet(id, xmlSubSubnet);
            if (xmlObject != null) {
                return xmlObject;
            }
        }
        return null;
    }