Making automatic loop diagrams

I am trying to automate the process of making Loop diagrams using Excel or Java based on the instruments found in a P&I Diagram. I am making a standard template and copying the loop details in the template based on the details of the instrument as i see in a P&I Diagram.
I am confused on

  1. how to make a loop diagram for multiple instruments in the same line , for ex PT, LT, PIC, and AT
  2. how does the loop diagram look like if I have an indicator and controller in the same instrument.
  3. How do I represent a control valve with controls for actuator and positioner in the same loop diagram.

Thanks in advance
Vilas D