In order to programmatically include a file to a project I use the method provided in this answer https://stackoverflow.com/a/23537007/1317323
Now I need to go further
I was able to do it using another namespace from Microsoft.
The solution is based on this one
Instead of manipulating my solution with
Microsoft.Build.Evaluation.Project
I use
Microsoft.VisualStudio.Shell.Interop
Now I manipulate
EnvDTE.Project
And I can use
_currentProject.ProjectItems.AddFromFile(path);
If I do it twice with a xaml and a xaml.cs file with the same name, there are automatically nested.