[quote What would be the best diagram and approach if I want to model a layered architecture and show multiple applications using the layers, so that the layers would have to be listed multiple times.
I tried to do this with a component diagram, and I modeled each layer as a package, but I could not have multiple instances of the package (nor any other type I could find).
Is there a better diagram where I can list components multiple times?
Thanks[/quote]
To show a layered architecture you can use a component diagram. Layers are notated with a "text element" that states the layer name then is followed by 100+ dashes so the text goes across the screen forming a boundary. You DO NOT use packages for layers! Packages represent a namespaces! Layers are conceptual and are not part of the UML! Do not follow anyone or any book that directs you otherwise!
Once you have your layers defined, you will have a bunch of dashes lines across your page. Now you drop components in their appropriate layer. Only dependencies between components are shown. In your example, I think you stated you will have an application layer with applications A, B, and C. These applications can be notated as components with dependencies on their respective sub-layer components.
In a typical layered architecture view, you never put a component or a layer in the diagram more than once, and you do not show behavior. I'm not sure where you're going here; I can only guess. If you're trying to show component instances, then your not doing a layered architecture view, you're probably doing a component "wiring" diagram with the layers in the background (which is irrelevant since you should have a layered architecture view first). In this diagram you wire together component instances to build a system. This is NOT a deployment! How and if you can do this for multiple applications in one diagram depends on the structure of your components (i.e. basic component, port-based component, subsystem component, etc).
In none of the cases above is behavior modeled. You need to look into the behavior diagrams to see which one is best. Layers are irrelevant in behavior diagrams. If you're trying to stick that in there, your approach is likely wrong as you're trying to do too much in one diagram.