Refactor edit_link method for xml classes

Change-Id: I3a4d50f673f476f646968810caace48adad754fd