Sure! Don't forget that the point of the comp format is that it stores the information unambiguously, but it is the point of front ends *to* the comp specification to hide some of these details from the user. So, for example, Antimony takes care of the initial assignments for you, as you guessed, by using metaids. The model:
model mod1()
x1 = 1+y
end
model mod2()
x2 = 1-z
end
model main()
A: mod1()
B: mod2()
A.x1 is xmain
B.x2 is xmain
end
gets translated to SBML as:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by libAntimony version v2.6.1 on 2015-01-21 08:54 with libSBML version 5.11.1. -->
<model id="main" name="main">
<listOfParameters>
<parameter id="xmain" constant="true">
<comp:listOfReplacedElements>
<comp:replacedElement comp:idRef="x1" comp:submodelRef="A"/>
<comp:replacedElement comp:idRef="x2" comp:submodelRef="B"/>
</comp:listOfReplacedElements>
</parameter>
</listOfParameters>
<comp:listOfSubmodels>
<comp:submodel comp:id="A" comp:modelRef="mod1"/>
<comp:submodel comp:id="B" comp:modelRef="mod2">
<comp:listOfDeletions>
<comp:deletion comp:metaIdRef="mod2__x2__initialAssignment"/>
</comp:listOfDeletions>
</comp:submodel>
</comp:listOfSubmodels>
</model>
<comp:listOfModelDefinitions>
<comp:modelDefinition id="mod1" name="mod1">
<listOfParameters>
<parameter id="x1" constant="true"/>
<parameter id="y" constant="true"/>
</listOfParameters>
<listOfInitialAssignments>
<initialAssignment symbol="x1">
<apply>
<plus/>
<cn type="integer"> 1 </cn>
<ci> y </ci>
</apply>
</math>
</initialAssignment>
</listOfInitialAssignments>
</comp:modelDefinition>
<comp:modelDefinition id="mod2" name="mod2">
<listOfParameters>
<parameter id="x2" constant="true"/>
<parameter id="z" constant="true"/>
</listOfParameters>
<listOfInitialAssignments>
<initialAssignment metaid="mod2__x2__initialAssignment" symbol="x2">
<apply>
<minus/>
<cn type="integer"> 1 </cn>
<ci> z </ci>
</apply>
</math>
</initialAssignment>
</listOfInitialAssignments>
</comp:modelDefinition>
</comp:listOfModelDefinitions>
</sbml>
which gives the extra initial assignment a metaid, and then uses that metaid in a deletion.
If you can't modify the submodel at all, even to give the initialAssignment a metaid, there's unfortunately nothing in the Hierarchical Composition package that will let you reference that element! This was a sort of compromise position in the end--we could have used the xpath operator to reference these elements, but the complexity of doing so was judged (at least for version 1) to be too much for a situation that, it was believed, would not come up all that often. If this turns out to be a major design barrier to you, however, we can consider adding it back in for version 2!
As far as 'replacedBy', unfortunately, Antimony does not use that construct at the moment in its output (though this could be added in the future). But I can mock you up an example. For simplicity, I'm just using parameters with a 'value' attribute:
<?xml version="1.0" encoding="UTF-8"?>
<model id="main" name="main">
<listOfParameters>
<parameter id="xmain" value="3" constant="true">
<comp:listOfReplacedElements>
<comp:replacedElement comp:idRef="x1" comp:submodelRef="A"/>
</comp:listOfReplacedElements>
<comp:replacedBy comp:idRef="x2" comp:submodelRef="B"/>
</parameter>
</listOfParameters>
<comp:listOfSubmodels>
<comp:submodel comp:id="A" comp:modelRef="mod1"/>
<comp:submodel comp:id="B" comp:modelRef="mod2"/>
</comp:listOfSubmodels>
</model>
<comp:listOfModelDefinitions>
<comp:modelDefinition id="mod1" name="mod1">
<listOfParameters>
<parameter id="x1" value="1" constant="true"/>
</listOfParameters>
</comp:modelDefinition>
<comp:modelDefinition id="mod2" name="mod2">
<listOfParameters>
<parameter id="x2" value="2" constant="true"/>
</listOfParameters>
</comp:modelDefinition>
</comp:listOfModelDefinitions>
</sbml>
In the above model, the parameter 'xmain' replaces x1 from submodel A, and is in turn replaced by x2 from submodel B. This means that in the final assessment, that parameter has a value of 2: the '1' and the '3' were both replaced. Note also that both x1 and xmain could have been set 'constant="false"', but the final assessment of the model would give that parameter a constant value of 'true', since that's what x2 had. (Just keep this in mind moving forward--if it's important that the final parameter have a value of '2' but 'constant=false', you'll need to create a new parameter at the top level with those attributes, and have it replace the others. Again, this is something a front end would ideally take care of.)
Is that clearer? Thanks for asking!
-Lucian