return target;
return replacement;
    private PropertyList resolveReferenceNode(PropertyList target) throws CdlException {        if (log.isDebugEnabled()) {            log.debug("processing reference " + target);        }        ReferencePath path;        path=target.getReferencePath();        assert path!=null: "Path is null on "+target.getDescription();        StepExecutionResult result = path.execute(target);        assert result.isFinished();        if(result.isLazyFlagFound()) {            //lazy was hit. we need to mark ourselves as lazy and continue without resolving            target.setLazy(true);            return target;        }        PropertyList dest = result.getNode();        assert dest !=null;        if(target==dest) {            return target;        }        //create a clone of the initial property list        //using a factory specific to the type of the current target, to        //ensure that toplevel lists get handled        PropertyList replacement=target.getFactory().create(dest);        replacement.setLocalName(target.getLocalName());        replacement.setNamespaceURI(target.getNamespaceURI());        replacement.setNamespacePrefix(target.getNamespacePrefix());        return target;    }