I have a large application targeting .NET 4.0.3 that needs to run on XP. It builds fine using Visual Studio 2010 SP1 and runs properly on XP.
Building using Visual S
It's possible to set the target system requirements under the Project Properties -> Publish -> Prerequisites panel (VS2012 with Update 1). Even though you're building for .NET 4 (Project Properties -> Application -> Target Framework) you'll need to change the prerequisites from 4.5 to 4 as it wont drop the requirements automatically.
Building with a target of 4 but prereq of 4.5 will start the installer but fail on system checks