I have always used xsd for schema validation, you can go to:
http://www.w3schools.com/ if you don't know it.
Don't understand your question, is interface always a
foreign key in hardware? If so, just make a new root element
that is above both interface and hardware. Then interfaces
can be within hardware, or can just be by themselves.