XML data schema to SQL table inserts

Hello, I have been trying to use this file to create a database using this XML file. I want my database structure the same as in this file and I don't understand what is wrong. and I am getting unexpected identifier when I put it in a query in SSMS. I have tried multiple tools online but did not work.
anything wrong wit the below code? ( I shortened it to fit)

GO  
USE SampleDB;  
GO  
CREATE XML SCHEMA COLLECTION test AS
<entities >
  <entity name="account" displayname="Account" etc="1" primaryidfield="accountid" primarynamefield="name" disableplugins="false">
    <fields>
      <field displayname="(Deprecated) Process Stage" name="stageid" type="guid" />
      <field displayname="(Deprecated) Traversed Path" name="traversedpath" type="string" />
      <field displayname="Account" name="accountid" type="guid" primaryKey="true" />
      <field displayname="Account Name" name="name" type="string" />
      <field displayname="Account Number" name="accountnumber" type="string" />
      <field displayname="Account Rating" name="accountratingcode" type="optionsetvalue" />
      <field displayname="Account Type" name="msnfp_accounttype" type="optionsetvalue" customfield="true" />
      <field displayname="Acquisition Date" name="msnfp_acquisitiondate" type="datetime" customfield="true" />
      <field displayname="Acquisition Source" name="msnfp_acquisitionsource" type="optionsetvalue" customfield="true" />
      <field displayname="Address 1" name="address1_composite" type="string" />
      <field displayname="Address 1: Address Type" name="address1_addresstypecode" type="optionsetvalue" />
      <field displayname="Address 1: City" name="address1_city" type="string" />
      <field displayname="Address 1: Country/Region" name="address1_country" type="string" />
      <field displayname="Address 1: County" name="address1_county" type="string" />
      <field displayname="Address 1: Fax" name="address1_fax" type="string" />
      <field displayname="Address 1: Freight Terms" name="address1_freighttermscode" type="optionsetvalue" />
      <field displayname="Address 1: ID" name="address1_addressid" type="guid" primaryKey="true" />
      <field displayname="Address 1: Latitude" name="address1_latitude" type="float" />
      <field displayname="Address 1: Longitude" name="address1_longitude" type="float" />
      <field displayname="Address 1: Name" name="address1_name" type="string" />
      <field displayname="Address 1: Post Office Box" name="address1_postofficebox" type="string" />
      <field displayname="Address 1: Primary Contact Name" name="address1_primarycontactname" type="string" />
      <field displayname="Address 1: Shipping Method" name="address1_shippingmethodcode" type="optionsetvalue" />
      <field displayname="Address 1: State/Province" name="address1_stateorprovince" type="string" />
      <field displayname="Address 1: Street 1" name="address1_line1" type="string" />
      <field displayname="Address 1: Street 2" name="address1_line2" type="string" />
      <field displayname="Address 1: Street 3" name="address1_line3" type="string" />
      <field displayname="Address 1: Telephone 2" name="address1_telephone2" type="string" />
      <field displayname="Address 1: Telephone 3" name="address1_telephone3" type="string" />
      <field displayname="Address 1: UPS Zone" name="address1_upszone" type="string" />
      <field displayname="Address 1: UTC Offset" name="address1_utcoffset" type="number" />
      <field displayname="Address 1: ZIP/Postal Code" name="address1_postalcode" type="string" />
      <field displayname="Address 2" name="address2_composite" type="string" />
      <field displayname="Address 2: Address Type" name="address2_addresstypecode" type="optionsetvalue" />
      <field displayname="Address 2: City" name="address2_city" type="string" />
      <field displayname="Address 2: Country/Region" name="address2_country" type="string" />
      <field displayname="Address 2: County" name="address2_county" type="string" />
      <field displayname="Address 2: Fax" name="address2_fax" type="string" />
      <field displayname="Address 2: Freight Terms" name="address2_freighttermscode" type="optionsetvalue" />
      <field displayname="Address 2: ID" name="address2_addressid" type="guid" primaryKey="true" />
      <field displayname="Address 2: Latitude" name="address2_latitude" type="float" />
      <field displayname="Address 2: Longitude" name="address2_longitude" type="float" />
      <field displayname="Address 2: Name" name="address2_name" type="string" />
      <field displayname="Address 2: Post Office Box" name="address2_postofficebox" type="string" />
      <field displayname="Address 2: Primary Contact Name" name="address2_primarycontactname" type="string" />
      <field displayname="Address 2: Shipping Method" name="address2_shippingmethodcode" type="optionsetvalue" />
      <field displayname="Address 2: State/Province" name="address2_stateorprovince" type="string" />
      <field displayname="Address 2: Street 1" name="address2_line1" type="string" />
      <field displayname="Address 2: Street 2" name="address2_line2" type="string" />
      <field displayname="Address 2: Street 3" name="address2_line3" type="string" />
      <field displayname="Address 2: Telephone 1" name="address2_telephone1" type="string" />
      <field displayname="Address 2: Telephone 2" name="address2_telephone2" type="string" />
      <field displayname="Address 2: Telephone 3" name="address2_telephone3" type="string" />
      <field displayname="Address 2: UPS Zone" name="address2_upszone" type="string" />
      <field displayname="Address 2: UTC Offset" name="address2_utcoffset" type="number" />
      <field displayname="Address 2: ZIP/Postal Code" name="address2_postalcode" type="string" />
      <field displayname="Address Phone" name="address1_telephone1" type="string" />
      <field displayname="Aging 30" name="aging30" type="money" />
      <field displayname="Aging 30 (Base)" name="aging30_base" type="money" />
      <field displayname="Aging 60" name="aging60" type="money" />
      <field displayname="Aging 60 (Base)" name="aging60_base" type="money" />
      <field displayname="Aging 90" name="aging90" type="money" />
      <field displayname="Aging 90 (Base)" name="aging90_base" type="money" />
      <field displayname="Annual Revenue" name="revenue" type="money" />
      <field displayname="Annual Revenue (Base)" name="revenue_base" type="money" />
      <field displayname="Business Type" name="businesstypecode" type="optionsetvalue" />
      <field displayname="Category" name="accountcategorycode" type="optionsetvalue" />
      <field displayname="Classification" name="accountclassificationcode" type="optionsetvalue" />
      <field displayname="Created By" name="createdby" type="entityreference" lookupType="systemuser" />
      <field displayname="Created By (Delegate)" name="createdonbehalfby" type="entityreference" lookupType="systemuser" />
      <field displayname="Created By (External Party)" name="createdbyexternalparty" type="entityreference" lookupType="externalparty" />
      <field displayname="Created On" name="createdon" type="datetime" />
      <field displayname="Credit Hold" name="creditonhold" type="bool" />
      <field displayname="Credit Limit" name="creditlimit" type="money" />
      <field displayname="Credit Limit (Base)" name="creditlimit_base" type="money" />
      <field displayname="Currency" name="transactioncurrencyid" type="entityreference" lookupType="transactioncurrency" />
      <field displayname="Customer Size" name="customersizecode" type="optionsetvalue" />
      <field displayname="Default Image" name="entityimage" type="imagedata" />
      <field displayname="Description" name="description" type="string" />
      <field displayname="Do not allow Bulk Emails" name="donotbulkemail" type="bool" />
      <field displayname="Do not allow Bulk Mails" name="donotbulkpostalmail" type="bool" />
      <field displayname="Do not allow Emails" name="donotemail" type="bool" />
      <field displayname="Do not allow Faxes" name="donotfax" type="bool" />
      <field displayname="Do not allow Mails" name="donotpostalmail" type="bool" />
      <field displayname="Do not allow Phone Calls" name="donotphone" type="bool" />
      <field displayname="Email" name="emailaddress1" type="string" />
      <field displayname="Email Address 2" name="emailaddress2" type="string" />
      <field displayname="Email Address 3" name="emailaddress3" type="string" />
      <field displayname="Entity Image Id" name="entityimageid" type="guid" />
      <field displayname="Exchange Rate" name="exchangerate" type="decimal" />
      <field displayname="Fax" name="fax" type="string" />
      <field displayname="Follow Email Activity" name="followemail" type="bool" />
      <field displayname="FTP Site" name="ftpsiteurl" type="string" />
      <field displayname="Import Sequence Number" name="importsequencenumber" type="number" />
      <field displayname="Industry" name="industrycode" type="optionsetvalue" />
      <field displayname="Last Date Included in Campaign" name="lastusedincampaign" type="datetime" />
      <field displayname="Last On Hold Time" name="lastonholdtime" type="datetime" />
      <field displayname="Last SLA applied" name="slainvokedid" type="entityreference" lookupType="sla" />
      <field displayname="Main Phone" name="telephone1" type="string" />
      <field displayname="Market Capitalization" name="marketcap" type="money" />
      <field displayname="Market Capitalization (Base)" name="marketcap_base" type="money" />
      <field displayname="Marketing Only" name="marketingonly" type="bool" />
      <field displayname="Master ID" name="masterid" type="entityreference" lookupType="account" />
      <field displayname="Merged" name="merged" type="bool" />
      <field displayname="Modified By" name="modifiedby" type="entityreference" lookupType="systemuser" />
      <field displayname="Modified By (Delegate)" name="modifiedonbehalfby" type="entityreference" lookupType="systemuser" />
      <field displayname="Modified By (External Party)" name="modifiedbyexternalparty" type="entityreference" lookupType="externalparty" />
      <field displayname="Modified On" name="modifiedon" type="datetime" />
      <field displayname="Number of Employees" name="numberofemployees" type="number" />
      <field displayname="On Hold Time (Minutes)" name="onholdtime" type="number" />
      <field displayname="Other Phone" name="telephone2" type="string" />
      <field displayname="Owner" name="ownerid" type="owner" />
      <field displayname="Ownership" name="ownershipcode" type="optionsetvalue" />
      <field displayname="Owning Business Unit" name="owningbusinessunit" type="entityreference" lookupType="businessunit" />
      <field displayname="Owning Team" name="owningteam" type="entityreference" lookupType="team" />
      <field displayname="Owning User" name="owninguser" type="entityreference" lookupType="systemuser" />
      <field displayname="Parent Account" name="parentaccountid" type="entityreference" lookupType="account" />
      <field displayname="Participates in Workflow" name="participatesinworkflow" type="bool" />
      <field displayname="Payment Terms" name="paymenttermscode" type="optionsetvalue" />
      <field displayname="Preferred Day" name="preferredappointmentdaycode" type="optionsetvalue" />
      <field displayname="Preferred Method of Contact" name="preferredcontactmethodcode" type="optionsetvalue" />
      <field displayname="Preferred Time" name="preferredappointmenttimecode" type="optionsetvalue" />
      <field displayname="Preferred User" name="preferredsystemuserid" type="entityreference" lookupType="systemuser" />
      <field displayname="Primary Constituent Type" name="msnfp_primaryconstituenttype" type="optionsetvalue" customfield="true" />
      <field displayname="Primary Contact" name="primarycontactid" type="entityreference" lookupType="contact" />
      <field displayname="Primary Satori ID" name="primarysatoriid" type="string" />
      <field displayname="Primary Twitter ID" name="primarytwitterid" type="string" />
      <field displayname="Process" name="processid" type="guid" />
      <field displayname="Record Created On" name="overriddencreatedon" type="datetime" />
      <field displayname="Relationship Type" name="customertypecode" type="optionsetvalue" />
      <field displayname="Send Marketing Materials" name="donotsendmm" type="bool" />
      <field displayname="Shares Outstanding" name="sharesoutstanding" type="number" />
      <field displayname="Shipping Method" name="shippingmethodcode" type="optionsetvalue" />
      <field displayname="SIC Code" name="sic" type="string" />
      <field displayname="SLA" name="slaid" type="entityreference" lookupType="sla" />
      <field displayname="Status" name="statecode" type="state" />
      <field displayname="Status Reason" name="statuscode" type="status" />
      <field displayname="Stock Exchange" name="stockexchange" type="string" />
      <field displayname="Telephone 3" name="telephone3" type="string" />
      <field displayname="Territory Code" name="territorycode" type="optionsetvalue" />
      <field displayname="Ticker Symbol" name="tickersymbol" type="string" />
      <field displayname="Time Spent by me" name="timespentbymeonemailandmeetings" type="string" />
      <field displayname="Time Zone Rule Version Number" name="timezoneruleversionnumber" type="number" />
      <field displayname="UTC Conversion Time Zone Code" name="utcconversiontimezonecode" type="number" />
      <field displayname="Website" name="websiteurl" type="string" />
      <field displayname="Yomi Account Name" name="yominame" type="string" />
    </fields>
    <relationships />
  </entity>
  <entity name="contact" displayname="Contact" etc="2" primaryidfield="contactid" primarynamefield="fullname" disableplugins="false">
    <fields>
      <field displayname="(Deprecated) Process Stage" name="stageid" type="guid" />
      <field displayname="(Deprecated) Traversed Path" name="traversedpath" type="string" />
      <field displayname="Account" name="accountid" type="entityreference" lookupType="account" />
      <field displayname="Address 1" name="address1_composite" type="string" />
      <field displayname="Address 1: Address Type" name="address1_addresstypecode" type="optionsetvalue" />
      <field displayname="Address 1: City" name="address1_city" type="string" />
      <field displayname="Address 1: Country/Region" name="address1_country" type="string" />
      <field displayname="Address 1: County" name="address1_county" type="string" />
      <field displayname="Address 1: Fax" name="address1_fax" type="string" />
      <field displayname="Address 1: Freight Terms" name="address1_freighttermscode" type="optionsetvalue" />
      <field displayname="Address 1: ID" name="address1_addressid" type="guid" primaryKey="true" />
      <field displayname="Address 1: Latitude" name="address1_latitude" type="float" />
      <field displayname="Address 1: Longitude" name="address1_longitude" type="float" />
      <field displayname="Address 1: Name" name="address1_name" type="string" />
      <field displayname="Address 1: Phone" name="address1_telephone1" type="string" />
      <field displayname="Address 1: Post Office Box" name="address1_postofficebox" type="string" />
      <field displayname="Address 1: Primary Contact Name" name="address1_primarycontactname" type="string" />
      <field displayname="Address 1: Shipping Method" name="address1_shippingmethodcode" type="optionsetvalue" />
      <field displayname="Address 1: State/Province" name="address1_stateorprovince" type="string" />
      <field displayname="Address 1: Street 1" name="address1_line1" type="string" />
      <field displayname="Address 1: Street 2" name="address1_line2" type="string" />
      <field displayname="Address 1: Street 3" name="address1_line3" type="string" />
      <field displayname="Address 1: Telephone 2" name="address1_telephone2" type="string" />
      <field displayname="Address 1: Telephone 3" name="address1_telephone3" type="string" />
      <field displayname="Address 1: UPS Zone" name="address1_upszone" type="string" />
      <field displayname="Address 1: UTC Offset" name="address1_utcoffset" type="number" />
      <field displayname="Address 1: ZIP/Postal Code" name="address1_postalcode" type="string" />
      <field displayname="Address 2" name="address2_composite" type="string" />
      <field displayname="Address 2: Address Type" name="address2_addresstypecode" type="optionsetvalue" />
      <field displayname="Address 2: City" name="address2_city" type="string" />
      <field displayname="Address 2: Country/Region" name="address2_country" type="string" />
      <field displayname="Address 2: County" name="address2_county" type="string" />
      <field displayname="Address 2: Fax" name="address2_fax" type="string" />
      <field displayname="Address 2: Freight Terms" name="address2_freighttermscode" type="optionsetvalue" />
      <field displayname="Address 2: ID" name="address2_addressid" type="guid" primaryKey="true" />
      <field displayname="Address 2: Latitude" name="address2_latitude" type="float" />
      <field displayname="Address 2: Longitude" name="address2_longitude" type="float" />
      <field displayname="Address 2: Name" name="address2_name" type="string" />
      <field displayname="Address 2: Post Office Box" name="address2_postofficebox" type="string" />
      <field displayname="Address 2: Primary Contact Name" name="address2_primarycontactname" type="string" />
      <field displayname="Address 2: Shipping Method" name="address2_shippingmethodcode" type="optionsetvalue" />
      <field displayname="Address 2: State/Province" name="address2_stateorprovince" type="string" />
      <field displayname="Address 2: Street 1" name="address2_line1" type="string" />
      <field displayname="Address 2: Street 2" name="address2_line2" type="string" />
      <field displayname="Address 2: Street 3" name="address2_line3" type="string" />
      <field displayname="Address 2: Telephone 1" name="address2_telephone1" type="string" />
      <field displayname="Address 2: Telephone 2" name="address2_telephone2" type="string" />
      <field displayname="Address 2: Telephone 3" name="address2_telephone3" type="string" />
      <field displayname="Address 2: UPS Zone" name="address2_upszone" type="string" />
      <field displayname="Address 2: UTC Offset" name="address2_utcoffset" type="number" />
      <field displayname="Address 2: ZIP/Postal Code" name="address2_postalcode" type="string" />
      <field displayname="Address 3" name="address3_composite" type="string" />
      <field displayname="Address 3: Address Type" name="address3_addresstypecode" type="optionsetvalue" />
      <field displayname="Address 3: City" name="address3_city" type="string" />
      <field displayname="Address 3: County" name="address3_county" type="string" />
      <field displayname="Address 3: Fax" name="address3_fax" type="string" />
      <field displayname="Address 3: Freight Terms" name="address3_freighttermscode" type="optionsetvalue" />
      <field displayname="Address 3: ID" name="address3_addressid" type="guid" primaryKey="true" />
      <field displayname="Address 3: Latitude" name="address3_latitude" type="float" />
      <field displayname="Address 3: Longitude" name="address3_longitude" type="float" />
      <field displayname="Address 3: Name" name="address3_name" type="string" />
      <field displayname="Address 3: Post Office Box" name="address3_postofficebox" type="string" />
      <field displayname="Address 3: Primary Contact Name" name="address3_primarycontactname" type="string" />
      <field displayname="Address 3: Shipping Method" name="address3_shippingmethodcode" type="optionsetvalue" />
      <field displayname="Address 3: Telephone1" name="address3_telephone1" type="string" />
      <field displayname="Address 3: Telephone2" name="address3_telephone2" type="string" />
      <field displayname="Address 3: Telephone3" name="address3_telephone3" type="string" />
      <field displayname="Address 3: UPS Zone" name="address3_upszone" type="string" />
      <field displayname="Address 3: UTC Offset" name="address3_utcoffset" type="number" />
      <field displayname="Address3: Country/Region" name="address3_country" type="string" />
      <field displayname="Address3: State/Province" name="address3_stateorprovince" type="string" />
      <field displayname="Address3: Street 1" name="address3_line1" type="string" />
      <field displayname="Address3: Street 2" name="address3_line2" type="string" />
      <field displayname="Address3: Street 3" name="address3_line3" type="string" />
      <field displayname="Address3: ZIP/Postal Code" name="address3_postalcode" type="string" />
      <field displayname="Age" name="msnfp_age" type="number" customfield="true" />
      <field displayname="Aging 30" name="aging30" type="money" />
      <field displayname="Aging 30 (Base)" name="aging30_base" type="money" />
      <field displayname="Aging 60" name="aging60" type="money" />
      <field displayname="Aging 60 (Base)" name="aging60_base" type="money" />
      <field displayname="Aging 90" name="aging90" type="money" />
      <field displayname="Aging 90 (Base)" name="aging90_base" type="money" />
      <field displayname="Anniversary" name="anniversary" type="datetime" />
      <field displayname="Annual Income" name="annualincome" type="money" />
      <field displayname="Annual Income (Base)" name="annualincome_base" type="money" />
      <field displayname="Anonymous?" name="msnfp_anonymous" type="bool" customfield="true" />
      <field displayname="Assistant" name="assistantname" type="string" />
      <field displayname="Assistant Phone" name="assistantphone" type="string" />
      <field displayname="Back Office Customer" name="isbackofficecustomer" type="bool" />
      <field displayname="Birth Day" name="msnfp_birthday" type="optionsetvalue" customfield="true" />
      <field displayname="Birth Month" name="msnfp_birthmonth" type="optionsetvalue" customfield="true" />
      <field displayname="Birth Year" name="msnfp_birthyear" type="number" customfield="true" />
      <field displayname="Birthday" name="birthdate" type="datetime" />
      <field displayname="Business Phone" name="telephone1" type="string" />
      <field displayname="Business Phone 2" name="business2" type="string" />
      <field displayname="Callback Number" name="callback" type="string" />
      <field displayname="Children's Names" name="childrensnames" type="string" />
      <field displayname="Company Name" name="parentcustomerid" type="entityreference" lookupType="account|contact" />
      <field displayname="Company Phone" name="company" type="string" />
      <field displayname="Contact" name="contactid" type="guid" primaryKey="true" />
      <field displayname="Contact Account Number" name="msnfp_contactaccountnumber" type="string" customfield="true" />
      <field displayname="Created By" name="createdby" type="entityreference" lookupType="systemuser" />
      <field displayname="Created By (Delegate)" name="createdonbehalfby" type="entityreference" lookupType="systemuser" />
      <field displayname="Created By (External Party)" name="createdbyexternalparty" type="entityreference" lookupType="externalparty" />
      <field displayname="Created On" name="createdon" type="datetime" />
      <field displayname="Credit Hold" name="creditonhold" type="bool" />
      <field displayname="Credit Limit" name="creditlimit" type="money" />
      <field displayname="Credit Limit (Base)" name="creditlimit_base" type="money" />
      <field displayname="Currency" name="transactioncurrencyid" type="entityreference" lookupType="transactioncurrency" />
      <field displayname="Customer Size" name="customersizecode" type="optionsetvalue" />
      <field displayname="Deceased?" name="msnfp_deceased" type="bool" customfield="true" />
      <field displayname="Department" name="department" type="string" />
      <field displayname="Description" name="description" type="string" />
      <field displayname="Do not allow Bulk Emails" name="donotbulkemail" type="bool" />
      <field displayname="Do not allow Bulk Mails" name="donotbulkpostalmail" type="bool" />
      <field displayname="Do not allow Emails" name="donotemail" type="bool" />
      <field displayname="Do not allow Faxes" name="donotfax" type="bool" />
      <field displayname="Do not allow Mails" name="donotpostalmail" type="bool" />
      <field displayname="Do not allow Phone Calls" name="donotphone" type="bool" />
      <field displayname="Education" name="educationcode" type="optionsetvalue" />
      <field displayname="Email" name="emailaddress1" type="string" />
      <field displayname="Email Address 2" name="emailaddress2" type="string" />
      <field displayname="Email Address 3" name="emailaddress3" type="string" />
      <field displayname="Employee" name="employeeid" type="string" />
      <field displayname="Entity Image" name="entityimage" type="imagedata" />
      <field displayname="Entity Image Id" name="entityimageid" type="guid" />
      <field displayname="Ethnicity" name="msnfp_ethnicity" type="optionsetvalue" customfield="true" />
      <field displayname="Exchange Rate" name="exchangerate" type="decimal" />
      <field displayname="External User Identifier" name="externaluseridentifier" type="string" />
      <field displayname="Fax" name="fax" type="string" />
      <field displayname="First Name" name="firstname" type="string" />
      <field displayname="Follow Email Activity" name="followemail" type="bool" />
      <field displayname="FTP Site" name="ftpsiteurl" type="string" />
      <field displayname="Full Name" name="fullname" type="string" />
      <field displayname="Gender" name="gendercode" type="optionsetvalue" />
      <field displayname="Government" name="governmentid" type="string" />
      <field displayname="Has Children" name="haschildrencode" type="optionsetvalue" />
      <field displayname="Home Phone" name="telephone2" type="string" />
      <field displayname="Home Phone 2" name="home2" type="string" />
      <field displayname="Import Sequence Number" name="importsequencenumber" type="number" />
      <field displayname="Job Title" name="jobtitle" type="string" />
      <field displayname="Last Date Included in Campaign" name="lastusedincampaign" type="datetime" />
      <field displayname="Last Name" name="lastname" type="string" />
      <field displayname="Last On Hold Time" name="lastonholdtime" type="datetime" />
      <field displayname="Last SLA applied" name="slainvokedid" type="entityreference" lookupType="sla" />
      <field displayname="Lead Source" name="leadsourcecode" type="optionsetvalue" />
      <field displayname="Maiden Name" name="msnfp_maidenname" type="string" customfield="true" />
      <field displayname="Manager" name="managername" type="string" />
      <field displayname="Manager Phone" name="managerphone" type="string" />
      <field displayname="Marital Status" name="familystatuscode" type="optionsetvalue" />
      <field displayname="Marketing Only" name="marketingonly" type="bool" />
      <field displayname="Master ID" name="masterid" type="entityreference" lookupType="contact" />
      <field displayname="Merged" name="merged" type="bool" />
      <field displayname="Middle Name" name="middlename" type="string" />
      <field displayname="Mobile Phone" name="mobilephone" type="string" />
      <field displayname="Modified By" name="modifiedby" type="entityreference" lookupType="systemuser" />
      <field displayname="Modified By (Delegate)" name="modifiedonbehalfby" type="entityreference" lookupType="systemuser" />
      <field displayname="Modified By (External Party)" name="modifiedbyexternalparty" type="entityreference" lookupType="externalparty" />
      <field displayname="Modified On" name="modifiedon" type="datetime" />
      <field displayname="Nickname" name="nickname" type="string" />
      <field displayname="No. of Children" name="numberofchildren" type="number" />
      <field displayname="On Hold Time (Minutes)" name="onholdtime" type="number" />
      <field displayname="Owner" name="ownerid" type="owner" />
      <field displayname="Owning Business Unit" name="owningbusinessunit" type="entityreference" lookupType="businessunit" />
      <field displayname="Owning Team" name="owningteam" type="entityreference" lookupType="team" />
      <field displayname="Owning User" name="owninguser" type="entityreference" lookupType="systemuser" />
      <field displayname="Pager" name="pager" type="string" />
      <field displayname="Parent Contact" name="parentcontactid" type="entityreference" lookupType="contact" />
      <field displayname="Participates in Workflow" name="participatesinworkflow" type="bool" />
      <field displayname="Payment Terms" name="paymenttermscode" type="optionsetvalue" />
      <field displayname="Preferred Day" name="preferredappointmentdaycode" type="optionsetvalue" />
      <field displayname="Preferred Method of Contact" name="preferredcontactmethodcode" type="optionsetvalue" />
      <field displayname="Preferred Time" name="preferredappointmenttimecode" type="optionsetvalue" />
      <field displayname="Preferred User" name="preferredsystemuserid" type="entityreference" lookupType="systemuser" />
      <field displayname="Primary Constituent Type" name="msnfp_primaryconstituenttype" type="optionsetvalue" customfield="true" />
      <field displayname="Process" name="processid" type="guid" />
      <field displayname="Record Created On" name="overriddencreatedon" type="datetime" />
      <field displayname="Relationship Type" name="customertypecode" type="optionsetvalue" />
      <field displayname="Reports To" name="msnfp_reportstoid" type="entityreference" lookupType="contact" customfield="true" />
      <field displayname="Role" name="accountrolecode" type="optionsetvalue" />
      <field displayname="Salutation" name="salutation" type="string" />
      <field displayname="Send Marketing Materials" name="donotsendmm" type="bool" />
      <field displayname="Shipping Method" name="shippingmethodcode" type="optionsetvalue" />
      <field displayname="SLA" name="slaid" type="entityreference" lookupType="sla" />
      <field displayname="Spouse/Partner Name" name="spousesname" type="string" />
      <field displayname="Status" name="statecode" type="state" />
      <field displayname="Status Reason" name="statuscode" type="status" />
      <field displayname="Suffix" name="suffix" type="string" />
      <field displayname="Telephone 3" name="telephone3" type="string" />
      <field displayname="Territory" name="territorycode" type="optionsetvalue" />
      <field displayname="Time Spent by me" name="timespentbymeonemailandmeetings" type="string" />
      <field displayname="Time Zone Rule Version Number" name="timezoneruleversionnumber" type="number" />
      <field displayname="UTC Conversion Time Zone Code" name="utcconversiontimezonecode" type="number" />
      <field displayname="Website" name="websiteurl" type="string" />
      <field displayname="Yomi First Name" name="yomifirstname" type="string" />
      <field displayname="Yomi Full Name" name="yomifullname" type="string" />
      <field displayname="Yomi Last Name" name="yomilastname" type="string" />
      <field displayname="Yomi Middle Name" name="yomimiddlename" type="string" />
    </fields>
    <relationships>
      <relationship name="msnfp_contact_assistants" manyToMany="true" relatedEntityName="msnfp_contact_assistants" m2mTargetEntity="contact" m2mTargetEntityPrimaryKey="contactid" />
    </relationships>
  </entity>

GO

I don't know if your schema is valid or consistent, but the first thing I see is that there is an opening tag , but no corresponding closing tag in your sample. That in and of itself would cause the query to fail emitting a syntax error message.