If Jesus was sinless then why was he baptized? If Jesus was sinless what is the biblical bases for needing to be baptized by John?

Mark 1:4-5 NIV 


  John did baptize in the wilderness, and preach the baptism of
  repentance for the remission of sins. And there went out unto him all
  the land of Judaea, and they of Jerusalem, and were all baptized of
  him in the river of Jordan, confessing their sins.
Jesus' baptism was not a confession of guilt. He fulfilled the rite of baptism because He identified Himself as one of us, taking the steps we are to take. His life of perfect submission here on earth is an example to us.


  Matthew 3 (NKJV) 
  
  14 And John tried to prevent Him, saying, “I need to be baptized by
  You, and are You coming to me?”
  
  15 But Jesus answered and said to him, “Permit it to be so now, for
  thus it is fitting for us to fulfill all righteousness.” Then he
  allowed Him.