I'm not sure what exactly is your rule but this can be done with substring.
Dim id As String = "123456789"
Dim result As String
result = id.Substring(0, 2).PadRight(id.Length - 2, "#") & id.Substring(id.Length - 2)
If you want an example on how to use it with your code. I would suggest making a function.
Function ShowPartialId(ByVal id As String)
Return id.Substring(0, 2).PadRight(id.Length - 2, "#") & id.Substring(id.Length - 2)
End Function
And then you just need to call the function
sErrorDetail.EmpID = ShowPartialId(node("EmpID").InnerText)