Kirchhoff-rules and field theory

Can you explain the field-theoretic origin of the two Kirchhoff-rules, the mesh rule and the knot rule?