Your
var Enteredby = XDocument.DOM.selectSingleNode("/my:myFields/my:EnteredBy").text;
line looks ok, but you will get that "object required" error if you reference a node that does not exist (e.g. it is in an optional section that is not included at the time) or if the XPath is misspelled, and that includes case. Please make sure that the node is actually called EnteredBy and not enteredBy or Enteredby.
There is definitely a problem with this line:
if(parseInt(Enteredby, 10) = ""){
if you want to compare two values you need to use the == operator, not =, but in this case, you should be using
if(isNaN(parseInt(Enteredby, 10)){
to check whether Enteredby is a valid number or not.