In order to check the correctness of a RDF representation code, and also parse them to a graph, several tools can be helpful. Here are several that I found.
1. W3C RDF validation service
It is the official one. It can convert a RDF/XML to N3 (Triples) representation and a graph. You can choose also the graph format. Additionally you can enter an URI where the XML file is.
As curiosity, in the extended interface, you can mark "I grant the W3C permission to save this RDF and to use it for developing test cases", giving the RDF to W3C.
This validator can convert from RDF/XML to N3 (Triples) and vice versa (From N3 to XML). The validator is not totally complete, but it could be very useful in many cases