Where would I find this OptIn SOurce node, and do I do the same thing even though you have switched from HTML to XHTML?
The OptInSource is set when you are creating a contact. HTML and XHTML wouldn't effect this as they only apply when you are creating an email. You can look at this information here.
View API documentation, code samples, get your API key.